Refer to the following object:
const cat ={
firstName: `Fancy',
lastName: ` Whiskers',
Get fullName() {
return this.firstName + ` ` + this.lastName;
}
};
How can a developer access the fullName property for cat?
A. cat.fullName
B. cat.fullName()
C. cat.get.fullName
D. cat.function.fullName()
Given the following code,what is the value of x? let x = `15' + (10 * 2);
A. 35
B. 50
C. 1520
D. 3020
Which option is true about the strict mode in imported modules?
A. Add the statement use non-strict, before any other statements in the module to enable not-strict mode.
B. You can only reference notStrict() functions from the imported module.
C. Imported modules are in strict mode whether you declare them as such or not.
D. Add the statement use strict =false; before any other statements in the module to enable not- strict mode.
Refer tothe code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
A. Inner function's scope
B. Hoisting
C. Outer function's scope
D. Prototype chain
Refer to the code below:
const event = new CustomEvent(
//Missing Code
);
obj.dispatchEvent(event);
A developer needs to dispatch a custom event called update to send information about recordId.
Which two options could a developer insert at the placeholder in line 02 to achieve this?
Choose 2 answers
A. `Update' , ( recordId : `123abc' (
B. `Update' , `123abc'
C. { type : `update', recordId : `123abc' }
D. `Update' , { Details : { recordId : `123abc' } }
Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() => console.log(" when am I called?"));
When does Promise.finally on line 08 get called?
A. When rejected
B. When resolved and settled
C. When resolved
D. When resolved or rejected
Refer to the following code:
What isthe value of output on line 11?
A. [1, 2]
B. [`'foo'', `'bar'']
C. [`'foo'':1, `'bar'':2'']
D. An error will occur due to the incorrect usage of the for...of statement on line 07.
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
Thedeveloper 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);
Refer to the following object.
How can a developer access the fullName property for dog?
A. Dog.fullName
B. Dog.fullName ( )
C. Dog, get, fullName
D. Dog, function, fullName
Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
A. JSON.stringify and JSON.parse
B. JSON.serialize and JSON.deserialize
C. JSON.encode and JSON.decode
D. JSON.parse and JSON.deserialize