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
  • 6,063
  • 5
  • 30
  • 35

1 Answers1

0

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

For IE: Yes

light
  • 411
  • 2
  • 2