Question 1

A developer has two ways to write a function:
Option A:
01 function Monster() {
02 this.growl = () => {
03 console.log("Grr!");
04 }
05 }
Option B:
01 function Monster() {};
02 Monster.prototype.growl = () => {
03 console.log("Grr!");
04 }
After deciding on an option, the developer creates 1000 monster objects. How many growl methods are created with Option A and Option B?
  • Question 2

    Considering type coercion, what does the following expression evaluate to?
    true + '13' + NaN
  • Question 3

    A developer copied a JavaScript object:

    How does the developer access dan's forstName,lastName? Choose 2 answers
  • Question 4

    01 function changeValue(obj) {
    02 obj.value = obj.value / 2;
    03 }
    04 const objA = {value: 10};
    05 const objB = objA;
    06
    07 changeValue(objB);
    08 const result = objA.value;
    What is the value of result after the code executes?
  • Question 5

    A developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
    Following semantic versioning formats, what should the new package version number be?