Available in 1, 3, 6 and 12 Months Free Updates Plans
PDF: $15 $60

Test Engine: $20 $80

PDF + Engine: $25 $99

JavaScript-Developer-I Practice Test


Page 13 out of 45 Pages

Refer to the code:

Given the code above, which three properties are set pet1?
Choose 3 answers:


A.

Name


B.

canTalk


C.

Type


D.

Owner


E.

Size





B.
  

canTalk



C.
  

Type



E.
  

Size



Refer to the code below:
Const pi = 3.1415326,
What is the data type of pi?


A.

Double


B.

Number


C.

Decimal


D.

Float





B.
  

Number



Refer to the code below:
function changeValue(param) {
Param =5;
}
Let a =10;
Let b =5;
changeValue(b);
Const result = a+ “ - ”+ b;
What is the value of result when code executes?


A.

10 -10


B.

5 -5


C.

5 - 10


D.

10 - 5





A.
  

10 -10



A developer needs to test this function:
01 const sum3 = (arr) => (
02 if (!arr.length) return 0,
03 if (arr.length === 1) return arr[0],
04 if (arr.length === 2) return arr[0] + arr[1],
05 return arr[0] + arr[1] + arr[2],
06 );
Which two assert statements are valid tests for the function?
Choose 2 answers


A.

console.assert(sum3(1, ‘2’)) == 12);


B.

console.assert(sum3(0)) == 0);


C.

console.assert(sum3(-3, 2 )) == -1);


D.

console.assert(sum3(‘hello’, 2, 3, 4)) === NaN);





A.
  

console.assert(sum3(1, ‘2’)) == 12);



C.
  

console.assert(sum3(-3, 2 )) == -1);



Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
The developer needs to insert a code statement in the location shown. The code
statement has these requirements:
1. Does require an import
2. Logs an error when the boolean statement evaluates to false
3. Works in both the browser and Node.js
Which meet the requirements?


A.

assert (number % 2 === 0);


B.

console.error(number % 2 === 0);


C.

console.debug(number % 2 === 0);


D.

console.assert(number % 2 === 0);





B.
  

console.error(number % 2 === 0);




Page 13 out of 45 Pages
Previous