web222
web222 copied to clipboard
Update README.md
function(a) does not work
Hey @philipabc, I noticed you closed this. Did you want to work on this together? Happy to review if so.
function(a) { console.log(arguments.length, a, arguments[0]); }
a("correct"); // 1, "correct", "correct" a("also", "correct"); // 2, "also", "also" a(); // 0, undefined, undefined
this code does not work. should it be changed to : function a(c) { console.log(arguments.length, a, arguments[0]); }
a("correct"); // 1, "correct", "correct" a("also", "correct"); // 2, "also", "also" a(); // 0, undefined, undefined
Sounds like a reasonable change to me, just one thing:
console.log(arguments.length, c, arguments[0]);
That is, the second arg passed to console.log() should be the argument to the function vs. the function itself.