Get Programming with JavaScript - Listings 13.01 and 13.02

Listings 13.01 and 13.02 - Loading JavaScript with a script tag

HTML:

<script src="http://output.jsbin.com/qezoce.js"></script>

JS:

var num = between(3, 7); console.log(num);

Further Adventures

Listings 13.01 and 13.02 - Loading JavaScript with a script tag - Tasks 2 & 3

var rect = { length: between(1, 10), width: between(1, 10) }; var showArea = function (rect) { var info = "A " + rect.length + " by " + rect.width; info += " rectangle has area " + rect.length * rect.width; console.log(info); }; showArea();