What is the output of the line 02?
Given the following code: Let x =null; console.log(typeof x); What is the output of the line 02?A . “Null”B . “X”C . “Object”D . “undefined”View AnswerAnswer: C
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instanceof a Post with the three attributes correctly populated?
A developer creates a class that represents a blog post based on the requirement that a Post should have a body author and view count. The Code shown Below: Class Post{ // Insert code here This.body =body This.author = author; this.viewCount = viewCount; } } Which statement should be inserted...
What is returned by the function call on line 13?
Refer to the following code: function test (val) { If (val === undefined) { return ‘Undefined values!’ ; } if (val === null) { return ‘Null value! ’; } return val; } Let x; test(x); What is returned by the function call on line 13?A . UndefinedB . Line 13...
Which assertion accurately tests the above code?
Refer to the code below: Async funct on functionUnderTest(isOK) { If (isOK) return ‘OK’; Throw new Error(‘not OK’); ) Which assertion accurately tests the above code?A . Console.assert (await functionUnderTest(true), ‘OK’)B . Console.assert (await functionUnderTest(true), ‘not OK’)C . Console.assert (await functionUnderTest(true), ‘notOK’)D . Console.assert (await functionUnderTest(true), ‘OK’)View AnswerAnswer: D
Which code assignment shows a correct way to convert this string to an integer?
Refer to the code below: Let textValue = ’1984’; Which code assignment shows a correct way to convert this string to an integer?A . let numberValue = Number(textValue);B . Let numberValue = (Number)textValue;C . Let numberValue = textValue.toInteger();D . Let numberValue = Integer(textValue);View AnswerAnswer: A
Which two console logs outputs NaN? Choose 2 answers
Which two console logs outputs NaN? Choose 2 answersA . console.log(10/ Number(‘5’));B . console.log(parseInt(‘two’));C . console.log(10/ ‘’five);D . console.log(10/0);View AnswerAnswer: B,C
Which two statements could be inserted at line 17 to enable the function call on line 18?
Refer to the following code: 01 function Tiger(){ 02this.Type = ‘Cat’; 03 this.size = ‘large’; 4 } 5 6 let tony = new Tiger(); 7 tony.roar = () =>{ 8 console.log(‘They’re great1’); 9 }; 10 11 function Lion(){ 12 this.type = ‘Cat’; 13 this.size = ‘large’; 14 } 15 16...
Which statement accurately describes an aspect of promises?
Which statement accurately describes an aspect of promises?A . Arguments for the callback function passed to .then() are optional.B . In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.C . .then() cannot be added after a catch.D . .then() manipulates and...
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console?
A developer is asked to fix some bugs reported by users. To do that, the developer adds abreakpoint for debugging. Function Car (maxSpeed, color) { This.maxspeed =masSpeed; This.color = color; Let carSpeed = document.getElementById(‘ CarSpeed’); Debugger; Let fourWheels =new Car (carSpeed.value, ‘red’); When the code execution stops at the breakpoint...
How can the developer change the code to ensure this behavior?
A developer wrote the following code: 01 let X = object.value; 02 03 try { 4 handleObjectValue(X); 5 } catch (error) { 6 handleError(error); 7 } The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs. How can the...