Which two console logs output NaN?
Choose 2 answers | |
B, D
A developer wants to use a module named universalContainersLib and then call functions from it.
How should a developer import every function from the module and then call the functions foo and
bar?
D
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers
A, C
Refer to the expression below:
Let x = (1 + 2) == (6 * 2);
How should this expression be modified to ensure that evaluates to false?
B
A developer implements and calls the following code when an application state change occurs:
Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, , null);
}
If the back button is clicked after this method is executed, what can a developer expect?
B
Refer to code below:
console.log(0);
setTimeout(() => (
console.log(1);
});
console.log(2);
setTimeout(() => {
console.log(3);
), 0);
console.log(4);
In which sequence will the numbers be logged?
C
Refer to code below:
Const objBook = {
Title: Javascript,
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = Robert;
What are the values of objBook and newObjBook respectively ?
A
Refer to the following array:
Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5] ?
Choose 3 answers.
B, C, D
In the browser, the window object is often used to assign variables that require the broadest scope in
an application Node.js application does not have access to the window object by default.
Which two methods are used to address this ?
Choose 2 answers
B
Refer to the code below:
Const myFunction = arr => {
Return arr.reduce((result, current) =>{
Return result = current;
}, 10};
}
What is the output of this function when called with an empty array ?
C
Which three browser specific APIs are available for developers to persist data between page loads ?
Choose 3 answers
A, B, E
A developer has two ways to write a function:
Option A:
function Monster() {
This.growl = () => {
Console.log (Grr!);
}
}
Option B:
function Monster() {};
Monster.prototype.growl =() => {
console.log(Grr!);
}
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?
B
Given the code below:
Setcurrent URL ();
console.log(The current URL is: +url );
function setCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
B
Refer to the code below:
let o = {
get js() {
let city1 = String("st. Louis");
let city2 = String(" New York");
return {
firstCity: city1.toLowerCase(),
secondCity: city2.toLowerCase(),
}
}
}
What value can a developer expect when referencing o.js.secondCity?
B
Why would a developer specify a package.jason as a developed forge instead of a dependency ?
B