You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fundamentals/exercises.md
+47-47Lines changed: 47 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,32 +8,32 @@ var x = s.toLowerCase();
8
8
var l =s.length;
9
9
```
10
10
11
-
**1. Indicate the type of each:**
11
+
**1. What are the types of the following:**
12
12
13
-
A. `s`
14
-
B. `x`
15
-
C. `s.toLowerCase( )`
16
-
D. `s.toLower Case`
17
-
E. `s.length`
18
-
F. `l`
13
+
1.`s`
14
+
2.`x`
15
+
3.`s.toLowerCase( )`
16
+
4.`s.toLower Case`
17
+
5.`s.length`
18
+
6.`l`
19
19
20
20
----
21
21
22
22
### 2. In `var x = 5 + 6;`, what is `+`?
23
23
24
-
A. Function
25
-
B. Operator
26
-
C. Number
27
-
D. Aggregator
24
+
1. Function
25
+
2. Operator
26
+
3. Number
27
+
4. Aggregator
28
28
29
29
----
30
30
31
-
### 3. In `var x = 5 + 6;`, what is 'var'?
31
+
### 3. In `var x = 5 + 6;`, what is `var`?
32
32
33
-
A. Variable
34
-
B. Keyword
35
-
C. Operator
36
-
D. Constant
33
+
1. Variable
34
+
2. Keyword
35
+
3. Operator
36
+
4. Constant
37
37
38
38
----
39
39
@@ -45,10 +45,10 @@ var x = z[y];
45
45
46
46
**4. What is `y`?**
47
47
48
-
A. Index
49
-
B. Key
50
-
C. Index or key
51
-
D. Array
48
+
1. Index
49
+
2. Key
50
+
3. Index or key
51
+
4. Array
52
52
53
53
----
54
54
@@ -62,10 +62,10 @@ var z = x[y];
62
62
63
63
**5. What is `y`?**
64
64
65
-
A. Index
66
-
B. Key
67
-
C. Index or key
68
-
D. Array
65
+
1. Index
66
+
2. Key
67
+
3. Index or key
68
+
4. Array
69
69
70
70
----
71
71
@@ -82,17 +82,17 @@ var joesAge = joe['age'];
82
82
83
83
**6. What is `'age'` in the last line?**
84
84
85
-
A. Index
86
-
B. Key
87
-
C. Property
88
-
D. Object
85
+
1. Index
86
+
2. Key
87
+
3. Property
88
+
4. Object
89
89
90
90
**7. What are `name` and `age` of the object `joe`?**
91
91
92
-
A. Index
93
-
B. Key
94
-
C. Object
95
-
D. Property
92
+
1. Index
93
+
2. Key
94
+
3. Object
95
+
4. Property
96
96
97
97
----
98
98
@@ -106,10 +106,10 @@ var z = x[y];
106
106
107
107
**7. What is `y`**
108
108
109
-
A. Index
110
-
B. Key
111
-
C. Index or key
112
-
D. Array
109
+
1. Index
110
+
2. Key
111
+
3. Index or key
112
+
4. Array
113
113
114
114
**8. What is the element for index `1` in array `x`?**
115
115
@@ -119,9 +119,9 @@ D. Array
119
119
120
120
### 10. What is the name of these functions?
121
121
122
-
A. `function a() { return true; }`
123
-
B. `var a = function b() { return true; }`
124
-
C. `var c = function () { return true; }`
122
+
1.`function a() { return true; }`
123
+
2.`var a = function b() { return true; }`
124
+
3.`var c = function () { return true; }`
125
125
126
126
----
127
127
@@ -135,10 +135,10 @@ C. `var c = function () { return true; }`
135
135
136
136
### 13. Write code for the following
137
137
138
-
A. Declare a variable called `x` and initialize it with the string "Hello".
139
-
B. Declare a variable called `y` and initialize it with the property `length` of `x`.
140
-
C. Declare a variable called `z` and initialize it with the result of calling the method `toUpperCase` on `x`
141
-
D. Declare a function called `myFunction`. This function should take two arguments, and should call the second argument with the first argument as its argument. Then, declare a variable called `f` and initialize it with an empty anonymous function, and call `myFunction` with the arguments `10` and `f`.
138
+
1. Declare a variable called `x` and initialize it with the string "Hello".
139
+
2. Declare a variable called `y` and initialize it with the property `length` of `x`.
140
+
3. Declare a variable called `z` and initialize it with the result of calling the method `toUpperCase` on `x`
141
+
4. Declare a function called `myFunction`. This function should take two arguments, and should call the second argument with the first argument as its argument. Then, declare a variable called `f` and initialize it with an empty anonymous function, and call `myFunction` with the arguments `10` and `f`.
142
142
143
143
----
144
144
@@ -158,10 +158,10 @@ var r = Math.sqrt(s);
158
158
159
159
### 15. Indicate for each of these whether it is an expression or a statement:
0 commit comments