View all detail and faqs for the JavaScript-Developer-I exam
Which code change should be done for the console to log the following when 'Click me!' is clicked'
> Row log
> Table log
myArraym can have one level, two levels, or more levels.
Which statement flattens myArray when it can be arbitrarily nested?
Refer to the following code:
What is the value of output on line 11?
Given the code below:
What is logged to the console'
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?
Given the followingcode, what is the value of x?
let x = ‘15' + (10 * 2);
A developer at Universal Containers creates a new landing page based on HTML, CSS, and
JavaScript TO ensure that visitors have a goodexperience, a script named personaliseContext
needs to be executed when the webpage is fully loaded (HTML content and all related files ), in
order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based onthe above
business requirement?
A developer wants to use a module called DataPrettyPrint. This moduleexports one default functioncalled printDate ().
How can a developer import and use the printDate() function?
A)
B)
C)
D)
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} ismaking a sound.`)
}
}
class Dog extends Animal{
constructor(name){
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking.`)
}
}
let myDog = new Dog('Puppy');
myDog.makeSound();
What is the consoleoutput?
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 logstatements?