Super Sale | Extra 20% Flat Off - Ends In Coupon code: GDAY20

JS Institute JSA-41-01

Page:    1 / 32   
Total 160 questions | Updated On: Apr 22, 2024
Question 1

What will be the value of x after the following code is executed?
let x = 10; 
function add5(num) {
 num += 5; 
 return num;
x = add5(x); 


Answer: C
Question 2

What will appear on the console after executing the following code?
let car = { model: "Tesla", year: 2022 }; 
let vehicle = {...car, color: "red"}; 
car.year = 2021; 
console.log(`${vehicle.model} ${vehicle.year} ${vehicle.color}`);


Answer: B
Question 3

What is the correct output of the following code:
var obj = {
  value: 10
};
var foo = function() {
  console.log(this.value);
};
var bar = function() {
  console.log(this.value);
};
var boundFoo = foo.call(obj);
var boundBar = bar.bind(obj)();
console.log(boundFoo === boundBar); 


Answer: C
Question 4

What line of code should be inserted into the Product class definition to add a property price to the class?
class Product { 
 constructor(name) 
 { 
   this.name = name; 
   // insert code here 
 }


Answer: B
Question 5

What will be the output when the following code is executed:
class Car { 
 _brand = ""; 
 set brand(value) { 
 this._brand = value; 
 } 
 get brand() { 
 return this._brand; 
 } 
let car = new Car(); 
car.brand = "Toyota"; 
console.log(car.brand) 


Answer: A
Page:    1 / 32   
Total 160 questions | Updated On: Apr 22, 2024

Quickly grab our JSA-41-01 product now and kickstart your exam preparation today!

Name: JSA - Certified Associate JavaScript Programmer
Exam Code: JSA-41-01
Certification: JavaScript
Vendor: JS Institute
Total Questions: 160
Last Updated: Apr 22, 2024