Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 8
List of questions
Related questions
Refer to the code below:
Line 05 causes an error.
What are the values of greeting and salutation once code completes?
Refer to the code below:
Let str = 'javascript';
Str[0] = 'J';
Str[4] = 'S';
After changing the string index values, the value of str is 'javascript'. What is the reason for this value:
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?
Refer to the following array:
Let arr1 = [ 1, 2, 3, 4, 5 ];
Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?
Refer to code below:
Function muFunction(reassign){ Let x = 1; var y = 1; if( reassign ) { Let x= 2; Var y = 2; console.log(x); console.log(y);} console.log(x); console.log(y);} What is displayed when myFunction(true) is called?
A developer wants to create an object from a function in the browser using the code below:
Function Monster() { this.name = 'hello' };
Const z = Monster();
What happens due to lack of the new keyword on line 02?
developer removes the HTML class attribute from the checkout button, so now it is simply:
<button>Checkout</button>.
There is a test to verify the existence of the checkout button, however it looks for a button with class= "blue". The test fails because no such button is found.
Which type of test category describes this test?
Which two code snippets show working examples of a recursive function?
Choose 2 answers
Refer to the HTML below:
<div id="main">
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing " Tony" to "Mr. T."?
Considering type coercion, what does the following expression evaluate to?
True + '13' + NaN
Question