Question 56

A developer executes:
document.cookie;
document.cookie = ' key=John Smith ' ;
What is the behavior?
  • Question 57

    Cloud Kicks has a class to represent items for sale in an online store, as shown below:
    Class Item{
    constructor (name, price){
    this.name = name;
    this.price = price;
    }
    formattedPrice(){
    return 's' + String(this.price);}}
    A new business requirement comes in that requests a ClothingItem class that should have all of the properties and methods of the Item class but will also have properties that are specific to clothes.
    Which line of code properly declares the clothingItem class such that it inherits from Item?
  • Question 58

    Given the code below:
    const delay = async delay =>{
    return new Promise((resolve,reject)=>{
    console.log(1);
    setTimeout(resolve,deleay);
    });
    };
    const callDelay = async ()=>{
    console.log(2);
    const yup = await delay(1000);
    console.log(3);
    }
    console.log(4);
    callDelay();
    console.log(5);
    What is logged to the console?
  • Question 59

    Refer to the following code block (with corrected template literals using backticks):
    01 class Animal {
    02 constructor(name) {
    03 this.name = name;
    04 }
    05
    06 makeSound() {
    07 console.log(`${this.name} is making a sound.`);
    08 }
    09 }
    10
    11 class Dog extends Animal {
    12 constructor(name) {
    13 super(name);
    14 this.name = name;
    15 }
    16 makeSound() {
    17 console.log(`${this.name} is barking.`);
    18 }
    19 }
    20
    21 let myDog = new Dog( ' Puppy ' );
    22 myDog.makeSound();
    What is the console output?
  • Question 60

    A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.
    The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server, js file will start the server. the developer wants to debug the Node.js server only using the terminal.
    Which command can the developer use to open the CLI debugger in their current terminal window?