Question:

What does the following code print to the console?

function full_name (first, last) {
  return first + " " + last + ": " + this.age;
}

shredder = {
  age: 37
}

console.log(full_name.apply(shredder, ["evil", "badguy"]));

Answer:

evil badguy: 37

The apply() method takes an array of arguments as the second parameter.


Keywords:

© 2017 QuizBucket.org