All Coursera Quiz Answers

Module quiz: Programming Paradigms Quiz Answers

In this article i am gone to share Coursera Course: Programming with JavaScript Week 3 |ย  Module quiz: Programming Paradigms Quiz Answers with you..

Programming with JavaScript Coursera Quiz Answers

Enroll Link: Programming with JavaScript


Also visit: Module quiz: The Building Blocks of a Program Quiz Answers


 

Module quiz: Programming Paradigms Quiz Answers

Question 1)
Variables declared using ‘let’ can be reassigned.

  • true
  • false

Question 2)
What will print out when the following code runs?

function scopeTest() {
var y = 44;
console.log(x);
}
var x = 33;
scopeTest();
  • null
  • undefined
  • 33
  • 44

Question 3)
What will print out when the following code runs?

class Cake {
constructor(lyr) {
this.layers = lyr;
}
getLayers() {
return this.layers;
}
}
  • 0
  • 2
  • 5
  • 10

Question 4)
What will print out when the following code runs?

class Animal {
}

class Dog extends Animal {
constructor() {
this.noise = "bark";
}
  • bark
  • growl
  • undefined

Question 5)
Consider this code snippet: ‘const [a, b] = [1,2,3,4] ‘. What is the value of b?

  • undefined
  • 1
  • 2
  • [1,2,3,4]

Question 6)
What value will be printed out when the following code runs?

function count(...food) {
console.log(food.length)
}
count("Burgers", "Fries", null);
  • 2
  • 3
  • “Burgers”, “Fries”, null
  • “Burgers”, “Fries”, undefined

Question 7)
Which of the following are JavaScript methods for querying the Document Object Model? Select all that apply.

  • getElementsByClassName
  • getElementsById
  • getElementById
  • getElementByClassName
  • queryAllSelectors
  • querySelector

Question 8)
Which of the following methods convert a JavaScript object to and from a JSON string?

  • JSON.parse
  • JSON.stringify
  • JSON.fromString
  • JSON.toString

Question 9)
What will be the result of running this code?

const letter = "a"
letter = "b"
  • Uncaught TypeError: Assignment to constant variable
  • b
  • a
  • Uncaught SyntaxError: Invalid or unexpected token

Question 10)
What is a constructor?

  • A function that is called to create an instance of an object.
  • An instance of a class.
  • A specific object that has been created using the class name.
  • An object literal