Question:

What does the following code print to the console?

phone = {
  ring: function () {
    return this === phone;
  }
}
console.log(phone.ring());

 

Answer:

true

The ring() function is invoked as a method, so the "this" keyword is assigned to the phone object.


Keywords:

© 2017 QuizBucket.org