Question 36

Which javascript methods can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
  • Question 37

    What are two unique features of functions defined with a fat arrow as compared to normal function definition?
    Choose 2 answers
  • Question 38

    A developer wants to create an object from a function in the browser using the code below.
    What happens due to lack of the new keyword on line 02?
  • Question 39

    A developer wants to iterate through an array of objects and count the objects and count
    the objects whose property value, name, starts with the letter N.
    Const arrObj = [{"name" : "Zach"} , {"name" : "Kate"},{"name" : "Alise"},{"name" : "Bob"},{"name" :
    "Natham"},{"name" : "nathaniel"}
    Refer to the code snippet below:
    01 arrObj.reduce(( acc, curr) => {
    02 //missing line 02
    02 //missing line 03
    04 ). 0);
    Which missing lines 02 and 03 return the correct count?
  • Question 40

    Refer to the code below:
    new Promise((resolve, reject) => {
    const fraction = Math.random();
    if( fraction >0.5) reject("fraction > 0.5, " + fraction);
    resolve(fraction);
    })
    .then(() =>console.log("resolved"))
    .catch((error) => console.error(error))
    .finally(() => console.log(" when am I called?"));

    When does Promise.finally on line 08 get called?