Question 6

Refer to the code below:
Function Person(firstName, lastName, eyecolor) {
this.firstName =firstName;
this.lastName = lastName;
this.eyeColor = eyeColor;
}
Person.job = 'Developer';
const myFather = new Person('John', 'Doe');
console.log(myFather.job);
What is the output after the code executes?
  • Question 7

    A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the function to run once after five seconds.
    What is the correct syntax toschedule this function?
  • Question 8

    Refer to the code below:
    Let car1 = new Promise((_ , reject) =>
    setTimeout(reject, 2000, "car 1 crashed in" =>
    Let car2 =new Promise(resolve => setTimeout(resolve, 1500, "car 2 completed") Let car3 =new Promise(resolve =>setTimeout(resolve, 3000, "car 3 completed") Promise.race(( car1, car2, car3))
    .then (value => (
    Let result = '$(value) the race.';)}
    .catch(arr => {
    console.log("Race is cancelled.", err);
    });
    What is the value of result when Promise.race executes?
  • Question 9

    A developer has an ErrorHandler module that contains multiple functions.
    What kind of export should be leveraged so that multiple functions can be used?
  • Question 10

    Which two console logs output NaN?
    Choose 2 answers | |