July 2011
Intermediate to advanced
276 pages
5h 11m
English
Objects and variables get confusing; save a few moments by making them report to us.
To test a battery of variables, one must instantiate a battery of variables.
// string variable, integer, array, object, null, undefined
var string_var = 'hello';
var integer_var = 1972;
var array_var = ['1','two',3];
var object_var = {one: '1', two: 'two', three: function() { alert(3); }}
var null_var;
//var oops_var; // commented out "on purpose"
Call a function that reports the type of each of our variables.
<h2>without moo:</h2> <script type="text/javascript"> report_typeOf(0); </script> <h2><strong>with</strong> moo:</h2> <script type="text/javascript"> report_typeOf(1); </script>