A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = ‘July’; const year = 2019;
if(year === 2019) { monthName = ‘June’;
}
Which line edit should be made to make this code run?
Correct Answer:
A
Given the following code: Counter = 0;
const logCounter = () => { console.log(counter);
);
logCounter(); setTimeout(logCOunter, 1100); setInterval(() => {
Counter++ logCounter();
}, 1000);
What is logged by the first four log statements?
Correct Answer:
C
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:
Correct Answer:
D
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?
Correct Answer:
A
GIven a value, which three options can a developer use to detect if the value is NaN? Choose 3 answers !
Correct Answer:
AE