forked from ga-wdi-exercises/js-data-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basics.js
44 lines (34 loc) · 1.57 KB
/
basics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( 15 );
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( "hello" );
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( [ "dog", "cat", "horse" ] );
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( NaN );
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburger" + "s";
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburgers" - "s";
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"johnny" + 5;
// What is the return value of the below code sample? Provide a sentence or two of explanation.
99 * "luftbaloons";
// 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 );
// What is the return value of the below code sample?
var morse = [ "dot", "pause", "dot" ];
var moreMorse = morse.join( " dash " );
moreMorse.split( " " );
// 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";