ganqqwerty / 123-Essential-JavaScript-Interview-Questions

JavaScript interview Questions
BSD 3-Clause "New" or "Revised" License
5.01k stars 1.18k forks source link

Fix bug in Q44 code #17

Closed jomadoye closed 6 years ago

jomadoye commented 7 years ago

This PR fixes a bug in Q44 code

ganqqwerty commented 6 years ago

The proper code is this:

function appLog() {
  var args = Array.prototype.slice.call(arguments);
  args.unshift('your app name');
  console.log.apply(console, args);
}

the arguments being a keyword.