|
11 | 11 | {
|
12 | 12 | "description":"Run the `varTest` function and look in the console.",
|
13 | 13 | "tests": [
|
14 |
| -"1/01/01" |
| 14 | +"01/01" |
15 | 15 | ],
|
16 | 16 | "hints": [
|
17 | 17 | "Click\"SAVE\". ⌘ + S on Mac, ctrl + S on Windows"
|
|
24 | 24 | {
|
25 | 25 | "description":"Change `var` to `let` and run the `letTest` function. Don't forget to look in the console.",
|
26 | 26 | "tests": [
|
27 |
| -"1/01/02" |
| 27 | +"01/02" |
28 | 28 | ],
|
29 | 29 | "actions": [
|
30 | 30 | "insert('\n// use `let` and call `letTest()`\nfunction letTest() {\n\tvar x = 3;\n\tif (true) {\n\t\tvar x = 4;\n\t\tconsole.log(x);\n\t}\n\tconsole.log(x);\n}\nletTest();\n\n\n')"
|
|
33 | 33 | {
|
34 | 34 | "description":"fix the broken loop to log numbers 1 to 5",
|
35 | 35 | "tests": [
|
36 |
| -"1/01/03" |
| 36 | +"01/03" |
37 | 37 | ],
|
38 | 38 | "actions": [
|
39 | 39 | "insert('\n// log numbers from 1 to 5\nfor (var i = 1; i <= 5 ; i++ ) {\n setTimeout(function() {\n console.log(i);\n })\n}\n// 6 6 6 6 6\n\n')"
|
|
49 | 49 | {
|
50 | 50 | "description":"Declare\"person\" as a `const`",
|
51 | 51 | "tests": [
|
52 |
| -"1/02/01" |
| 52 | +"02/01" |
53 | 53 | ],
|
54 | 54 | "actions": [
|
55 | 55 | "open('const.js')",
|
|
59 | 59 | {
|
60 | 60 | "description":"Declare\"person\" as a constant. Check the log to see what will happen.",
|
61 | 61 | "tests": [
|
62 |
| -"1/02/02" |
| 62 | +"02/02" |
63 | 63 | ],
|
64 | 64 | "actions": [
|
65 | 65 | "insert('\n// declare person as a const\n// cannot be redeclared\nvar person = {\n name: 'Shawn',\n city: 'Vancouver'\n};\n\nperson = {\n name: 'Unknown',\n city: 'Las Vegas'\n};\n\nperson.favoriteColor = 'blue';\n\n// what will the output be?\nconsole.log(person);\n\n\n')"
|
|
68 | 68 | {
|
69 | 69 | "description":"Declare\"people\" as a constant. Check the log again.",
|
70 | 70 | "tests": [
|
71 |
| -"1/02/03" |
| 71 | +"02/03" |
72 | 72 | ],
|
73 | 73 | "actions": [
|
74 | 74 | "insert('\n// declare people as a const\n\nvar people = ['Mandi', 'Mack', 'Ben'];\n\npeople = [];\n\npeople.push('Shawn');\n\n// what will the output be?\nconsole.log(people);\n\n')"
|
|
83 | 83 | {
|
84 | 84 | "description":"Change the\"greet\" function to use an `=>` function",
|
85 | 85 | "tests": [
|
86 |
| -"1/03/01" |
| 86 | +"03/01" |
87 | 87 | ],
|
88 | 88 | "actions": [
|
89 | 89 | "open('arrow-function.js')",
|
|
93 | 93 | {
|
94 | 94 | "description":"Change the\"getName\" function to use an `=>` function without using the keyword `return`",
|
95 | 95 | "tests": [
|
96 |
| -"1/03/02" |
| 96 | +"03/02" |
97 | 97 | ],
|
98 | 98 | "actions": [
|
99 | 99 | "insert('\n// use => no return statement\nconst getName = function getName() {\n\treturn 'Joe';\n}\n\n\n')"
|
|
102 | 102 | {
|
103 | 103 | "description":"Fix the broken clock by using arrow functions.",
|
104 | 104 | "tests": [
|
105 |
| -"1/03/03" |
| 105 | +"03/03" |
106 | 106 | ],
|
107 | 107 | "actions": [
|
108 | 108 | "insert('\n// fix the clock\n// http://codepen.io/redacademy/pen/mPjXVW\n\n')"
|
|
122 | 122 | "set('// change the output to a template literal\n\nfunction template() {\n console.log('I know what a backtick is');\n}\ntemplate();\n\n\n')"
|
123 | 123 | ],
|
124 | 124 | "tests": [
|
125 |
| -"1/04/01" |
| 125 | +"04/01" |
126 | 126 | ]
|
127 | 127 | },
|
128 | 128 | {
|
129 | 129 | "description":"rewrite `multiline` to use template literals",
|
130 | 130 | "tests": [
|
131 |
| -"1/04/02" |
| 131 | +"04/02" |
132 | 132 | ],
|
133 | 133 | "actions": [
|
134 | 134 | "insert('\nfunction multiline() {\n\tconsole.log('1.\\n2.\\n3.');\n}\nmultiline();\n// 1.\n// 2.\n// 3.\n\n\n')"
|
|
137 | 137 | {
|
138 | 138 | "description":"rewrite `expressions` to use template literals",
|
139 | 139 | "tests": [
|
140 |
| -"1/04/03" |
| 140 | +"04/03" |
141 | 141 | ],
|
142 | 142 | "hints": [
|
143 | 143 | "Use `${expressions}`"
|
|
160 | 160 | "set('// rewrite in a simpler way\nfunction getPersonObj(name, city) {\n return {\n name: name,\n city: city\n };\n}\n')"
|
161 | 161 | ],
|
162 | 162 | "tests": [
|
163 |
| -"1/05/01" |
| 163 | +"05/01" |
164 | 164 | ]
|
165 | 165 | }
|
166 | 166 | ]
|
|