Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 12
List of questions
Related questions
Refer to code below:
Let first = 'who';
Let second = 'what';
Try{
Try{
Throw new error('Sad trombone');
}catch (err){
First ='Why';
}finally {
Second ='when';
} catch (err) {
Second ='Where';
}
What are the values for first and second once the code executes ?
Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
Refer to following code block:
Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];
Let output =0;
For (let num of array){
if (output >0){
Break;
}i
f(num % 2 == 0){
Continue;
}
Output +=num;
What is the value of output after the code executes?
Refer to the code below:
<html lang="en">
<table onclick="console.log(Table log');">
<tr id="row1">
<td>Click me!</td>
</tr>
<table>
<script> function printMessage(event) { console.log('Row log');
}
Let elem = document.getElementById('row1'); elem.addEventListener('click', printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Row log when 'Click me! ' is clicked?
Refer to code below:
Let a ='a';
Let b;
// b = a; console.log(b);
What is displayed when the code executes?
Refer to the code below:
let timeFunction =() => {
console.log('Timer called.");
};
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers
developer has a web server running with Node.js. The command to start the web server is node server,js. The web server started having latency issues. Instead of a one second turn around for web requests, the developer now sees a five second turnaround, Which command can the web developer run to see what the module is doing during the latency period?
Refer to the code below:
Let foodMenu1 = ['pizza', 'burger', 'French fries'];
Let finalMenu = foodMenu1;
finalMenu.push('Garlic bread');
What is the value of foodMenu1 after the code executes?
Refer to code below:
Let productSKU = '8675309' ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon, starting with 'sku', and padded with zeros.
Which statement assigns the values sku0000000008675309 ?
Question