1
Array.prototype.toString = function(){
    return "testing";
}

a1 = [1,2,3];

console.log(a1); // returns [1,2,3]
console.log(a1.toString()); // returns "testing"

why is that? How does the first log print out values? I thought it used the toString method?

user1099123
  • 5,191
  • 5
  • 27
  • 32

1 Answers1

0

For Firefox(both Firebug and Dev Web Console), Chrome: No

For IE: Yes

light
  • 391
  • 1
  • 2