@palerock/exam-qa 1.0.6-patch18 → 1.0.6-patch19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map +1 -1
- package/lib-json/[JS]/347/254/254/344/270/200/347/253/240 /345/217/230/351/207/217-/347/261/273/345/236/213-/351/233/206/345/220/210.json" +20 -20
- package/lib-json/[JS]/347/254/254/344/270/203/347/253/240 /346/265/213/350/257/225.json" +9 -9
- package/lib-json/[JS]/347/254/254/344/270/211/347/253/240 /346/265/217/350/247/210/345/231/250/345/222/214/344/272/213/344/273/266.json" +28 -28
- package/lib-json/[JS]/347/254/254/344/272/214/347/253/240 /345/257/271/350/261/241-/345/207/275/346/225/260-/347/261/273.json" +46 -46
- package/lib-json/[JS]/347/254/254/344/272/224/347/253/240 /345/274/202/346/255/245/347/274/226/347/250/213.json" +30 -30
- package/lib-json/[JS]/347/254/254/345/205/255/347/253/240 /346/234/215/345/212/241/345/231/250/347/253/257JavaScript.json" +17 -17
- package/lib-json/[JS]/347/254/254/345/233/233/347/253/240 /350/260/203/350/257/225/345/222/214/351/224/231/350/257/257/345/244/204/347/220/206.json" +8 -8
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap 80567ef6e9265ef1af22"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 80567ef6e9265ef1af22"],"sourceRoot":""}
|
@@ -41,11 +41,11 @@
|
|
41
41
|
"isRight": true
|
42
42
|
},
|
43
43
|
{
|
44
|
-
"describe": "<p>et x = arr.filter((a)
|
44
|
+
"describe": "<p>et x = arr.filter((a)=> { return a<=2 });</p>",
|
45
45
|
"isRight": true
|
46
46
|
},
|
47
47
|
{
|
48
|
-
"describe": "<p>et x = arr.filter((a)
|
48
|
+
"describe": "<p>et x = arr.filter((a) => { a<= 2 });</p>",
|
49
49
|
"isRight": false
|
50
50
|
},
|
51
51
|
{
|
@@ -195,7 +195,7 @@
|
|
195
195
|
"hashCode": -739401847
|
196
196
|
},
|
197
197
|
{
|
198
|
-
"describe": "<p>Refer to the code snippet below:</p><p>01 let array = [1, 2, 3, 4, 4, 5, 4, 4];</p><p>02 for (let i = 0 ; i
|
198
|
+
"describe": "<p>Refer to the code snippet below:</p><p>01 let array = [1, 2, 3, 4, 4, 5, 4, 4];</p><p>02 for (let i = 0 ; i< array.length; i++) {</p><p>03 if (array[i] === 4) {</p><p>04 array.splice(i, 1) ;</p><p>05 i--;</p><p>06 }</p><p>07 }</p><p>What is the value of array after the code executes?</p>",
|
199
199
|
"answerOptions": [
|
200
200
|
{
|
201
201
|
"describe": "<p>[1, 2, 3, 4, 4, 5, 4]</p>",
|
@@ -244,19 +244,19 @@
|
|
244
244
|
"describe": "<p>A developer has the following array of student test grades:</p><p>let arr = [7,8,5,8,9];</p><p>The teacher wants to double each score and then see an array of the students who scored more than 15 points.</p><p>How should the developer implement the request?</p>",
|
245
245
|
"answerOptions": [
|
246
246
|
{
|
247
|
-
"describe": "<p>let arr1 = arr.map( ( num )
|
247
|
+
"describe": "<p>let arr1 = arr.map( ( num ) => num * 2 ).filter ( (val ) => val > 15);</p>",
|
248
248
|
"isRight": true
|
249
249
|
},
|
250
250
|
{
|
251
|
-
"describe": "<p>let arr1 = arr.mapBy( (num )
|
251
|
+
"describe": "<p>let arr1 = arr.mapBy( (num ) => {return num * 2 } ).filterBy ( (val ) => {return val > 15 });</p>",
|
252
252
|
"isRight": false
|
253
253
|
},
|
254
254
|
{
|
255
|
-
"describe": "<p>let arr1 = arr.map ( (num)
|
255
|
+
"describe": "<p>let arr1 = arr.map ( (num) => {num * 2}).filterBy((val) => {val >15});</p>",
|
256
256
|
"isRight": false
|
257
257
|
},
|
258
258
|
{
|
259
|
-
"describe": "<p>let arr1 = arr.filter((val)
|
259
|
+
"describe": "<p>let arr1 = arr.filter((val) => { return val > 15} ).map((num) => { return num * 2});</p>",
|
260
260
|
"isRight": false
|
261
261
|
}
|
262
262
|
],
|
@@ -267,7 +267,7 @@
|
|
267
267
|
"describe": "<p>Refer to the following array:</p><p>let arr = [1,2,3,4,5];</p><p>Which three options result in x evaluating as [3, 4, 5] ? Choose 3 answer</p>",
|
268
268
|
"answerOptions": [
|
269
269
|
{
|
270
|
-
"describe": "<p>let x = arr.filter((a)
|
270
|
+
"describe": "<p>let x = arr.filter((a)=> { return a>2 });</p>",
|
271
271
|
"isRight": true
|
272
272
|
},
|
273
273
|
{
|
@@ -279,7 +279,7 @@
|
|
279
279
|
"isRight": true
|
280
280
|
},
|
281
281
|
{
|
282
|
-
"describe": "<p>let x = arr.filter((a)
|
282
|
+
"describe": "<p>let x = arr.filter((a) => { a< 2 });</p>",
|
283
283
|
"isRight": false
|
284
284
|
},
|
285
285
|
{
|
@@ -294,19 +294,19 @@
|
|
294
294
|
"describe": "<p>Refer to the code below:</p><p>const searchText = 'Yay! Salesforce is amazing!' ;</p><p>let result1 = searchText.search(/sales/i) ;</p><p>let result2 = searchText. search(/sales/) ;</p><p>console.log(result1) ;</p><p>console.log(result2) ;</p><p>After running this code, which result is displayed on the console?</p>",
|
295
295
|
"answerOptions": [
|
296
296
|
{
|
297
|
-
"describe": "<p
|
297
|
+
"describe": "<p>>5 > undefined</p>",
|
298
298
|
"isRight": false
|
299
299
|
},
|
300
300
|
{
|
301
|
-
"describe": "<p
|
301
|
+
"describe": "<p>> true > false</p>",
|
302
302
|
"isRight": false
|
303
303
|
},
|
304
304
|
{
|
305
|
-
"describe": "<p
|
305
|
+
"describe": "<p>>5 >0</p>",
|
306
306
|
"isRight": false
|
307
307
|
},
|
308
308
|
{
|
309
|
-
"describe": "<p
|
309
|
+
"describe": "<p>>5 >-1</p>",
|
310
310
|
"isRight": true
|
311
311
|
}
|
312
312
|
],
|
@@ -787,7 +787,7 @@
|
|
787
787
|
"hashCode": 942113396
|
788
788
|
},
|
789
789
|
{
|
790
|
-
"describe": "<p>Refer to the code snippet below:</p><p>01 let array = [1, 2, 3, 4, 4, 5, 4, 4];</p><p>02 for (let i = 0 ; i
|
790
|
+
"describe": "<p>Refer to the code snippet below:</p><p>01 let array = [1, 2, 3, 4, 4, 5, 4, 4];</p><p>02 for (let i = 0 ; i< array.length; i++) {</p><p>03 if (array[i] === 4) {</p><p>04 array.splice(i, 1) ;</p><p>05 }</p><p>06 }</p><p>What is the value of array after the code executes?</p><p></p>",
|
791
791
|
"answerOptions": [
|
792
792
|
{
|
793
793
|
"describe": "<p>[1, 2, 3, 4, 4, 5, 4]</p>",
|
@@ -886,23 +886,23 @@
|
|
886
886
|
"describe": "<p>Given two expressions var1 and var2, what are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean? Choose 2 answers</p><p></p>",
|
887
887
|
"answerOptions": [
|
888
888
|
{
|
889
|
-
"describe": "<p>Boolean(var1)
|
889
|
+
"describe": "<p>Boolean(var1) && Boolean(var2)</p>",
|
890
890
|
"isRight": true
|
891
891
|
},
|
892
892
|
{
|
893
|
-
"describe": "<p>var1
|
893
|
+
"describe": "<p>var1 && var2</p>",
|
894
894
|
"isRight": false
|
895
895
|
},
|
896
896
|
{
|
897
|
-
"describe": "<p>var1.toBoolean( )
|
897
|
+
"describe": "<p>var1.toBoolean( ) && var2. toBoolean ( )</p>",
|
898
898
|
"isRight": false
|
899
899
|
},
|
900
900
|
{
|
901
|
-
"describe": "<p>Boolean(var1
|
901
|
+
"describe": "<p>Boolean(var1 && var2)</p>",
|
902
902
|
"isRight": true
|
903
903
|
}
|
904
904
|
],
|
905
|
-
"analysis": "<p>var1
|
905
|
+
"analysis": "<p>var1 && var2 output 2</p>",
|
906
906
|
"hashCode": 1061090132
|
907
907
|
},
|
908
908
|
{
|
@@ -925,7 +925,7 @@
|
|
925
925
|
"isRight": true
|
926
926
|
}
|
927
927
|
],
|
928
|
-
"analysis": "<p>https://developer.mozilla.org/en-US/docs/Glossary/Mutable#:~:text=In%20JavaScript%2C%20only%20objects%20and,is%20still%20held%20in%20memory.&text=Immutables%20are%20the%20objects%20whose,Strings%20and%20Numbers%20are%20Immutable.</p>",
|
928
|
+
"analysis": "<p>https://developer.mozilla.org/en-US/docs/Glossary/Mutable#:~:text=In%20JavaScript%2C%20only%20objects%20and,is%20still%20held%20in%20memory.&text=Immutables%20are%20the%20objects%20whose,Strings%20and%20Numbers%20are%20Immutable.</p>",
|
929
929
|
"hashCode": 1724487884
|
930
930
|
},
|
931
931
|
{
|
@@ -3,10 +3,10 @@
|
|
3
3
|
"category": "JS-1",
|
4
4
|
"questions": [
|
5
5
|
{
|
6
|
-
"describe": "<p>The developer wants to test this code:</p><p>const toNumber = (strOrNum)
|
6
|
+
"describe": "<p>The developer wants to test this code:</p><p>const toNumber = (strOrNum) => +strOrNum ;</p><p>Which two tests are most accurate for this code? Choose 2 answers</p>",
|
7
7
|
"answerOptions": [
|
8
8
|
{
|
9
|
-
"describe": "<p>console.assert (toNumber('-3')
|
9
|
+
"describe": "<p>console.assert (toNumber('-3') < 0) ;</p>",
|
10
10
|
"isRight": false
|
11
11
|
},
|
12
12
|
{
|
@@ -22,18 +22,18 @@
|
|
22
22
|
"isRight": true
|
23
23
|
}
|
24
24
|
],
|
25
|
-
"analysis": "<p>explain: +'2' will be converted to 2, which is a number</p><p>toNumber(), output: NaN</p><p>console.assert (toNumber('-3')
|
25
|
+
"analysis": "<p>explain: +'2' will be converted to 2, which is a number</p><p>toNumber(), output: NaN</p><p>console.assert (toNumber('-3') < 0) ; is not most accurate</p>",
|
26
26
|
"hashCode": -1147043528
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"describe": "<p>The developer wants to test the array shown:</p><p>const arr = Array(5). fill(0);</p><p>Which two tests are the most accurate for this array? Choose 2 answers</p>",
|
30
30
|
"answerOptions": [
|
31
31
|
{
|
32
|
-
"describe": "<p>arr . forEach(elem
|
32
|
+
"describe": "<p>arr . forEach(elem => console . assert(elem === 0)) ;</p>",
|
33
33
|
"isRight": true
|
34
34
|
},
|
35
35
|
{
|
36
|
-
"describe": "<p>console . assert(arr[0] === 0
|
36
|
+
"describe": "<p>console . assert(arr[0] === 0 && arr[arr . length] === 0) ;</p>",
|
37
37
|
"isRight": false
|
38
38
|
},
|
39
39
|
{
|
@@ -41,11 +41,11 @@
|
|
41
41
|
"isRight": true
|
42
42
|
},
|
43
43
|
{
|
44
|
-
"describe": "<p>console . assert (arr . length
|
44
|
+
"describe": "<p>console . assert (arr . length > 0);</p>",
|
45
45
|
"isRight": false
|
46
46
|
}
|
47
47
|
],
|
48
|
-
"analysis": "<p>console . assert(arr[0] === 0
|
48
|
+
"analysis": "<p>console . assert(arr[0] === 0 && arr[arr . length] === 0) ; is not most accurate</p>",
|
49
49
|
"hashCode": 1515758694
|
50
50
|
},
|
51
51
|
{
|
@@ -260,7 +260,7 @@
|
|
260
260
|
"hashCode": 1279788027
|
261
261
|
},
|
262
262
|
{
|
263
|
-
"describe": "<p>The developer wants to test this code:</p><p>const stringifyNumber = (num)
|
263
|
+
"describe": "<p>The developer wants to test this code:</p><p>const stringifyNumber = (num) => Number(num).toString();</p><p>Which two tests are the most accurate for this code? Choose 2 answers</p><p></p>",
|
264
264
|
"answerOptions": [
|
265
265
|
{
|
266
266
|
"describe": "<p>console.assert(stringifyNunber() === 'NaN')</p>",
|
@@ -329,7 +329,7 @@
|
|
329
329
|
"hashCode": 1254240553
|
330
330
|
},
|
331
331
|
{
|
332
|
-
"describe": "<p>A developer removes the checkout button that looked like this:</p><p
|
332
|
+
"describe": "<p>A developer removes the checkout button that looked like this:</p><p><button class = 'blue'>Checkout</button></p><p>There are multiple components in the component with class ='blue'. An existing test verifies the existence of the checkout button, however it looks for a button with class='blue'. It succeeds because a button with class='blue' is found. Which type of test category describes this test?</p><p></p>",
|
333
333
|
"answerOptions": [
|
334
334
|
{
|
335
335
|
"describe": "<p>true positive</p>",
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"category": "JS-1",
|
4
4
|
"questions": [
|
5
5
|
{
|
6
|
-
"describe": "<p>Refer to the HTML below:</p><p
|
6
|
+
"describe": "<p>Refer to the HTML below:</p><p><div id = \"main\"></p><p><ul></p><p><li>Leo</li></p><p><li>Tony</li></p><p><li>Tiger</li></p><p></ul></p><p></div></p><p>Which JavaScript statement results in changing “Tony\" to \"Mr.T.\"?</p>",
|
7
7
|
"answerOptions": [
|
8
8
|
{
|
9
9
|
"describe": "<p>document.querySelector('#main</p><p>li : nth-child (2)').innerHTML = 'Mr.T.';</p>",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"hashCode": 591770595
|
27
27
|
},
|
28
28
|
{
|
29
|
-
"describe": "<p>Given</p><p>the HTML below:</p><p
|
29
|
+
"describe": "<p>Given</p><p>the HTML below:</p><p><div></p><p><div id</p><p>=\"row-uc\">Universal Containers</div></p><p><div id</p><p>=\"row-as\">Applied Shipping</div></p><p><div id</p><p>=\"row-bt\">Burlington Textiles</div></p><p></div></p><p>Which statement adds the priority-account CSS class to the Universal</p><p>Containers row?</p>",
|
30
30
|
"answerOptions": [
|
31
31
|
{
|
32
32
|
"describe": "<p>document.querySelectorAll('#row-uc').classList.add('priority-account');</p>",
|
@@ -145,7 +145,7 @@
|
|
145
145
|
"hashCode": -998090915
|
146
146
|
},
|
147
147
|
{
|
148
|
-
"describe": "<p>UC recently launched its new landing page to host a crowd funding campaign. The page uses an external library to display some third-party ads. Once the page is fully loaded, it creates more than 50 new HTML item placed randomly inside the DOM, like the one in the codebelow:</p><p
|
148
|
+
"describe": "<p>UC recently launched its new landing page to host a crowd funding campaign. The page uses an external library to display some third-party ads. Once the page is fully loaded, it creates more than 50 new HTML item placed randomly inside the DOM, like the one in the codebelow:</p><p>< img src=\" /ad- library/ad01.gif\" /></p><p>All the elements include the same ad-library-item class. They are hidden by default, and they are randomly displayed while the user navigates through the page.</p><p>Tired of all the ads, what can the developer do to temporarily and quickly remove them?</p>",
|
149
149
|
"answerOptions": [
|
150
150
|
{
|
151
151
|
"describe": "<p>Use the DOM inspector to remove all the elements containing the class ad-library-item.</p>",
|
@@ -168,7 +168,7 @@
|
|
168
168
|
"hashCode": 396955090
|
169
169
|
},
|
170
170
|
{
|
171
|
-
"describe": "<p>A developer implements and calls the following code when an application state change occurs:</p><p>const onStatechange = (newPageState)
|
171
|
+
"describe": "<p>A developer implements and calls the following code when an application state change occurs:</p><p>const onStatechange = (newPageState)=> {</p><p>window. history. pushState (newPageState, ' ', null) ;</p><p>If the back button is clicked after this method is executed, what can a developer expect?</p>",
|
172
172
|
"answerOptions": [
|
173
173
|
{
|
174
174
|
"describe": "<p>The page reloads and all JavaScript is reinitialized .</p>",
|
@@ -191,7 +191,7 @@
|
|
191
191
|
"hashCode": -649318349
|
192
192
|
},
|
193
193
|
{
|
194
|
-
"describe": "<p>Refer to the HTML below:</p><p
|
194
|
+
"describe": "<p>Refer to the HTML below:</p><p><p> The current status of an Order: <span id=\"status\"> In Progress </span> </p ></p><p>Which JavaScript statement changes the text 'In Progress' to 'Completed' ?</p>",
|
195
195
|
"answerOptions": [
|
196
196
|
{
|
197
197
|
"describe": "<p>document.getElementById(\".status\").innerHTML = 'Completed' ;</p>",
|
@@ -214,7 +214,7 @@
|
|
214
214
|
"hashCode": 1671046131
|
215
215
|
},
|
216
216
|
{
|
217
|
-
"describe": "<p>A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console.</p><p>Here is the HTML file content:</p><p
|
217
|
+
"describe": "<p>A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console.</p><p>Here is the HTML file content:</p><p><input type=\"text\" value=\"Hello\" name=\"input\"></p><p><button type=\"button\">Display</button></p><p>The developer wrote the JavaScript code below:</p><p>01 const button = document.querySelector ('button');</p><p>02 button.addEventListener('click', ( ) => {</p><p>03 const input = document.querySelector('input');</p><p>04 console.log (input.getAttribute('value'));</p><p>05 });</p><p>When the user clicks the button, the output is always \"Hello\".</p><p>What needs to be done to make this code work as expected?</p><p></p>",
|
218
218
|
"answerOptions": [
|
219
219
|
{
|
220
220
|
"describe": "<p>Replace line 04 with console.log(input.value);</p>",
|
@@ -260,7 +260,7 @@
|
|
260
260
|
"hashCode": -1471083619
|
261
261
|
},
|
262
262
|
{
|
263
|
-
"describe": "<p>Given two nested divs and the code below:</p><p>window.onload = (event)
|
263
|
+
"describe": "<p>Given two nested divs and the code below:</p><p>window.onload = (event) => {</p><p>document.querySelector('.outerDiv')</p><p>.addEventListener('click', displayOuterMessage, true);</p><p>document.querySelector('.innerDiv')</p><p>.addEventListener('click', displayInnerMessage, true);</p><p>};</p><p>What order will the event listeners be called when the innerDiv is clicked?</p><p></p>",
|
264
264
|
"answerOptions": [
|
265
265
|
{
|
266
266
|
"describe": "<p>displayInnerMessage, displayOuterMessage</p>",
|
@@ -356,7 +356,7 @@
|
|
356
356
|
"hashCode": -634315088
|
357
357
|
},
|
358
358
|
{
|
359
|
-
"describe": "<p
|
359
|
+
"describe": "<p><html></p><p><body></p><p><div></p><p><ul class=\"first\"></p><p><li>Item 1</li></p><p><li>Item 2</li></p><p></ul></p><p><ul class=\"second\"></p><p><li>Item 3</li></p><p><li>Item 4</li></p><p><li>Item 5</li></p><p></ul></p><p></div></p><p><script></p><p>let elements = document.querySelectorAll('div, ul > li:last-child, * ul.first li');</p><p>console.log(elements.length);</p><p></script></p><p></body></p><p></html></p><p>Given the code above, what is the length of elements?</p><p></p>",
|
360
360
|
"answerOptions": [
|
361
361
|
{
|
362
362
|
"describe": "<p>6</p>",
|
@@ -379,7 +379,7 @@
|
|
379
379
|
"hashCode": -1252572505
|
380
380
|
},
|
381
381
|
{
|
382
|
-
"describe": "<p
|
382
|
+
"describe": "<p><!DOCTYPE html></p><p><html></p><p><body></p><p><form>FORM</p><p><div>DIV</p><p><p>P</p></p><p></div></p><p></form></p><p><script></p><p>for(let elem of document.querySelectorAll('*')) {</p><p>elem.addEventListener(\"click\", e => console.log(`Bubbling: ${elem.tagName}`)); elem.addEventListener(\"click\", e => console.log(`Capturing: ${elem.tagName}`), true);</p><p>}</p><p></script></p><p></body></p><p></html></p><p>Given the code above, which one of the following will be the correct output in the console when you click on the paragraph element?</p><p></p>",
|
383
383
|
"answerOptions": [
|
384
384
|
{
|
385
385
|
"describe": "<p>“Capturing: P”</p><p>“Bubbling: P”</p><p>“Capturing: DIV”</p><p>“Bubbling: DIV”</p><p>“Capturing: FORM”</p><p>“Bubbling: FORM”</p><p>“Capturing: BODY”</p><p>“Bubbling: BODY”</p><p>“Capturing: HTML”</p><p>“Bubbling: HTML”</p>",
|
@@ -425,7 +425,7 @@
|
|
425
425
|
"hashCode": 760715380
|
426
426
|
},
|
427
427
|
{
|
428
|
-
"describe": "<p
|
428
|
+
"describe": "<p><div id=\"elem\"></div></p><p><script></p><p>// get the element</p><p>let elem = ____________;</p><p>// set background as red color</p><p>elem.style.background = 'red';</p><p></script></p><p>Given the code above, what would you write in the blank field on line 4? Choose 1 answer.</p><p></p>",
|
429
429
|
"answerOptions": [
|
430
430
|
{
|
431
431
|
"describe": "<p>html.getElementById('elem');</p>",
|
@@ -448,7 +448,7 @@
|
|
448
448
|
"hashCode": 1024050894
|
449
449
|
},
|
450
450
|
{
|
451
|
-
"describe": "<p
|
451
|
+
"describe": "<p><form onclick=\"alert('form')\">FORM</p><p><div onclick=\"alert('div')\">DIV</p><p><p onclick=\"alert('p')\">P</p></p><p></div></p><p></form></p><p>what would happen when the div element block is clicked?</p><p></p>",
|
452
452
|
"answerOptions": [
|
453
453
|
{
|
454
454
|
"describe": "<p>alert('div') will show first, then alert('form').</p>",
|
@@ -494,7 +494,7 @@
|
|
494
494
|
"hashCode": 73646446
|
495
495
|
},
|
496
496
|
{
|
497
|
-
"describe": "<p>Refer to the code below:</p><p>01
|
497
|
+
"describe": "<p>Refer to the code below:</p><p>01 <html lang=\"en\"></p><p>02 <table onclick=\"console. log('Table log');\"></p><p>03 <tr id=\"row1\"></p><p>04 <td>Click me!</td></p><p>05 </tr></p><p>06 </table></p><p>07 <script></p><p>08 function printMessage (event) {</p><p>09 console.log('Row log') ;</p><p>10 }</p><p>11</p><p>12 let elem = document. getElementById('row1') ;</p><p>13 elem. addEventListener('click', printMessage, false) ;</p><p>14 </script></p><p>15 </html></p><p>Which code change should be made for the console to log only Row log when 'Click me!' is clicked?</p><p></p>",
|
498
498
|
"answerOptions": [
|
499
499
|
{
|
500
500
|
"describe": "<p>Add event. stopPropagation( ); to printMessage function.</p>",
|
@@ -544,7 +544,7 @@
|
|
544
544
|
"hashCode": -1101212415
|
545
545
|
},
|
546
546
|
{
|
547
|
-
"describe": "<p>Refer to the following code:</p><p>01
|
547
|
+
"describe": "<p>Refer to the following code:</p><p>01 <html></p><p>02 <body></p><p>03 <div onclick=\"console.log('Outer message');\" ></p><p>04 <button id=\"myButton\">Click me!</button></p><p>05 </div></p><p>06 </body></p><p>07 <script></p><p>08 function displayMessage(ev) {</p><p>09 ev.stopPropagation( ) ;</p><p>10 console.log('Inner message.') ;</p><p>11 }</p><p>12 const elem = document. getElementById('myButton') ;</p><p>13 elem.addEventListener('click', displayMessage) ;</p><p>14 </scrípt></p><p>15 </html></p><p>What will the console show when the button is clicked?</p><p></p>",
|
548
548
|
"answerOptions": [
|
549
549
|
{
|
550
550
|
"describe": "<p>Inner message</p>",
|
@@ -593,19 +593,19 @@
|
|
593
593
|
"describe": "<p>Which code statement below correctly persists an object in localStorage?</p><p></p>",
|
594
594
|
"answerOptions": [
|
595
595
|
{
|
596
|
-
"describe": "<p>const setLocalStorage = (storageKey, jsObject)
|
596
|
+
"describe": "<p>const setLocalStorage = (storageKey, jsObject) => {</p><p>window.localStorage.persist (storageKey, jsObject) ;</p><p>}</p>",
|
597
597
|
"isRight": false
|
598
598
|
},
|
599
599
|
{
|
600
|
-
"describe": "<p>const setLocalStorage = (storageKey, jsObject)
|
600
|
+
"describe": "<p>const setLocalStorage = (storageKey, jsObject) => { window.localStorage.setItem(storageKey, JSON. stringify(jsObject)) ;</p><p>}</p>",
|
601
601
|
"isRight": true
|
602
602
|
},
|
603
603
|
{
|
604
|
-
"describe": "<p>const setLocalStorage = (jsObject)
|
604
|
+
"describe": "<p>const setLocalStorage = (jsObject) => { window·localStorage·connectObject(jsObject);</p><p>}</p>",
|
605
605
|
"isRight": false
|
606
606
|
},
|
607
607
|
{
|
608
|
-
"describe": "<p>const setLocalStorage = (jsObject)
|
608
|
+
"describe": "<p>const setLocalStorage = (jsObject) => {</p><p>window.localStorage·setItem (jsObject);</p><p>}</p>",
|
609
609
|
"isRight": false
|
610
610
|
}
|
611
611
|
],
|
@@ -613,7 +613,7 @@
|
|
613
613
|
"hashCode": -615328800
|
614
614
|
},
|
615
615
|
{
|
616
|
-
"describe": "<p>Given the following code:</p><p>01 document.body.addEventListener('click', (event)
|
616
|
+
"describe": "<p>Given the following code:</p><p>01 document.body.addEventListener('click', (event) => {</p><p>02 if (/* CODE REPLACEMENT HERE */) {</p><p>03 console.log( 'Button clicked!') ;</p><p>04 }</p><p>05 }) ;</p><p>Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on the page is clicked?</p><p></p>",
|
617
617
|
"answerOptions": [
|
618
618
|
{
|
619
619
|
"describe": "<p>event.target.nodeName == 'BUTTON'</p>",
|
@@ -659,7 +659,7 @@
|
|
659
659
|
"hashCode": -950730568
|
660
660
|
},
|
661
661
|
{
|
662
|
-
"describe": "<p>Refer to the HTML below:</p><p
|
662
|
+
"describe": "<p>Refer to the HTML below:</p><p><div id=\"main\"></p><p><div id=\"card-00\">This card is smaller.</div></p><p><div id=\"card-01\">The width and height of this card is determined by its contents. </div></p><p></div></p><p>Which expression outputs the screen width of the element with the ID card-01?</p><p></p>",
|
663
663
|
"answerOptions": [
|
664
664
|
{
|
665
665
|
"describe": "<p>document.getElementById( 'card-01' ).style.width</p>",
|
@@ -709,7 +709,7 @@
|
|
709
709
|
"hashCode": 1569259728
|
710
710
|
},
|
711
711
|
{
|
712
|
-
"describe": "<p>Refer to the code below:</p><p>01 document.body.addEventListener('click', (event)
|
712
|
+
"describe": "<p>Refer to the code below:</p><p>01 document.body.addEventListener('click', (event) => {</p><p>02 if ( /* ANSWER HERE */) {</p><p>03 console.log('myElement clicked!');</p><p>04 }</p><p>05 });</p><p>Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a specific element, myElement, on the page had been clicked?</p><p></p>",
|
713
713
|
"answerOptions": [
|
714
714
|
{
|
715
715
|
"describe": "<p>e.nodeTarget == myElement</p>",
|
@@ -732,7 +732,7 @@
|
|
732
732
|
"hashCode": 437895865
|
733
733
|
},
|
734
734
|
{
|
735
|
-
"describe": "<p>Refer to the following code:</p><p>01
|
735
|
+
"describe": "<p>Refer to the following code:</p><p>01 <html></p><p>02 <body></p><p>03 <span onclick=\"console.log('Span message');\"></p><p>04 <button id=\"myButton\">Send message!</button></p><p>05 </span></p><p>06 </body></p><p>07 <script></p><p>08 function displayMessage(ev) {</p><p>09 ev.stopPropagation();</p><p>10 console.log('Button message');</p><p>11 }</p><p>12 const elem = document.getElementById('myButton');</p><p>13 elem.addEventListener('click', displayMessage);</p><p>14 </script></p><p>15 </html></p><p>What will the console show when the button is clicked?</p><p></p>",
|
736
736
|
"answerOptions": [
|
737
737
|
{
|
738
738
|
"describe": "<p>Span message</p>",
|
@@ -755,22 +755,22 @@
|
|
755
755
|
"hashCode": 1848855696
|
756
756
|
},
|
757
757
|
{
|
758
|
-
"describe": "<p>Refer to the following code:</p><p>01
|
758
|
+
"describe": "<p>Refer to the following code:</p><p>01 <html></p><p>02 <div></p><p>03 <button>Click me!</button></p><p>04 </div></p><p>05 <script></p><p>06 function displayInnerMessage(ev) {</p><p>07 console.log('Inner message.');</p><p>08 }</p><p>09 function displayOuterMessage(ev) {</p><p>10 console.log('Outer message.');</p><p>11 }</p><p>12</p><p>13 window.onload = (event) => {</p><p>14 document.querySelector('.outerDiv')</p><p>15 .addEventListener('click', displayOuterMessage, true);</p><p>16 document.querySelector('.myButton')</p><p>17 .addEventListener('click', displayInnerMessage, true);</p><p>18 };</p><p>19 </script></p><p>20 </html></p><p>What will the console show when the button is clicked?</p><p></p>",
|
759
759
|
"answerOptions": [
|
760
760
|
{
|
761
|
-
"describe": "<p
|
761
|
+
"describe": "<p>> Outer message.</p>",
|
762
762
|
"isRight": false
|
763
763
|
},
|
764
764
|
{
|
765
|
-
"describe": "<p
|
765
|
+
"describe": "<p>> Inner message.</p><p>> Outer message.</p>",
|
766
766
|
"isRight": false
|
767
767
|
},
|
768
768
|
{
|
769
|
-
"describe": "<p
|
769
|
+
"describe": "<p>> Inner message.</p>",
|
770
770
|
"isRight": true
|
771
771
|
},
|
772
772
|
{
|
773
|
-
"describe": "<p
|
773
|
+
"describe": "<p>> Outer message.</p><p>> Inner message.</p>",
|
774
774
|
"isRight": false
|
775
775
|
}
|
776
776
|
],
|
@@ -778,7 +778,7 @@
|
|
778
778
|
"hashCode": -978870915
|
779
779
|
},
|
780
780
|
{
|
781
|
-
"describe": "<p>Refer to the HTML below:</p><p
|
781
|
+
"describe": "<p>Refer to the HTML below:</p><p><div id=\"main\"></p><p><div id=\"card-00\">This card is smaller.</div></p><p><div id=\"card-01\">The width and height of this card is determined by its contents. </div></p><p></div></p><p>Which statement outputs the height of the element with the ID card-01?</p><p></p>",
|
782
782
|
"answerOptions": [
|
783
783
|
{
|
784
784
|
"describe": "<p>document.getElementById( 'card-01' ).style.height</p>",
|
@@ -801,7 +801,7 @@
|
|
801
801
|
"hashCode": -1734822652
|
802
802
|
},
|
803
803
|
{
|
804
|
-
"describe": "<p>A developer wants to create a simple image upload in the browser using the File API. The HTML is below:</p><p
|
804
|
+
"describe": "<p>A developer wants to create a simple image upload in the browser using the File API. The HTML is below:</p><p><imput type=\"file\" onchange=\"previewFile()\"></p><p><img src=\"\" height=\"200\" alt=\"Image preview…\"/></p><p>The JavaScript portion is:</p><p>01 function previewFile() {</p><p>02 const preview = document.querySelector('img');</p><p>03 const file = document.querySelector('input[type=file]').files[0];</p><p>04 // line 4 code</p><p>05 reader.addEventListener(\"load\", () => {</p><p>06 preview.src = reader.result;</p><p>07 }, false);</p><p>08 // line 8 code</p><p>09 }</p><p>In lines 04 and 08, which code allows the user to select an image from their local computer, and to display the image in the browser?</p><p></p>",
|
805
805
|
"answerOptions": [
|
806
806
|
{
|
807
807
|
"describe": "<p>04 const reader = new File();</p><p>08 if (file) reader.readAsDataURL(file);</p>",
|