
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( 15 );

A: number, it is not wrapped in quotes and therefore is not a string.  

// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( "hello" );

A: string.  "hello" is wrapped in quotes and is therefore a string.

// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( [ "dog", "cat", "horse" ] );

A: Array.  Brackets determine arrays.

// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( NaN );

A: Number.  NaN is not a number, but is lumped in the category of numbers, b/c it deals with numbers.

// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburger" + "s";

A: hamburgers.  when two strings are + togethers, they concactenate.

// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburgers" - "s";

A: NaN.  B/c of the subtraction operator it thinks your doing math, but because no numbers are detected, NaN is the result.

// What is the return value of the below code sample? Provide a sentence or two of explanation.
"johnny" + 5;

A: johnny5.  strings get concactenated.  

// What is the return value of the below code sample? Provide a sentence or two of explanation.
99 * "luftbaloons";

A: NaN.  It's trying to do math b/c of the *, but since "luftbaloons" is NaN, it doesn't have another number to *.

// What will the contents of the below array be after the below code sample is executed.
var numbers = [ 2, 4, 6, 8 ];
numbers.pop();
numbers.push( 10 );
numbers.unshift( 3 );

A: 3,2,4,6,10

pop, pops out 8, push pushes in 10 to back and unshift adds 3 to the front.

// What is the return value of the below code sample?
var morse = [ "dot", "pause", "dot" ];
var moreMorse = morse.join( " dash " );
moreMorse.split( " " );

A: [dot, dash, pause, dash, dot]

moreMorse is a new var that joins morse array by dashes.  Then you split all the items by one space into a new array.

// What will the contents of the below array be after the below code sample is executed.
var bands = [];
var beatles = [ "Paul", "John", "George", "Pete" ];
var stones = [ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ];
bands.push( beatles );
bands.unshift( stones );
bands[ bands.length - 1 ].pop();
bands[0].shift();
bands[1][3] = "Ringo";

A: bands = [["Mick","Keith","Ronnie","Charlie"],["Paul","John","George","Ringo"]];

Add beatles array to bands array, then stones array to front of bands array. bands.length is 2, then - 1 equals 1.  Pop out Pete since Beatles is second array.  Next shift out Brian(RIP) from the stones.  Last step is adding in Ringo, 2nd array in bands, 4th beatle in beatles.



