0
var arr = [];
console.log(arr)
arr.push( something )
console.log(arr) 
arr.push( something )
console.log(arr)
arr.push( something ) 
console.log(arr)
arr.sort(somefunction())
console.log(arr)

In Chrome and FireFox, the output is like

[]
[object]
[object,object]
[object,object,object]
[object,object,object] 

but when I expand the array for details, all of the result is the array after sort.

[object,object,object] 
[object,object,object] 
[object,object,object] 
[object,object,object] 
[object,object,object] 

Is this the bug of the Browser, JavaScript or just an error I made in my code.

Alexis Tyler
  • 1,394
  • 6
  • 30
  • 48
ZeroZerg
  • 427
  • 3
  • 14
  • It's a mistake you made in thinking what "expand for details" means. This is neither a bug nor an error in the code – Bergi Dec 16 '15 at 06:05
  • Btw, `.sort(someFunction())` is possibly a mistake and should be `.sort(someFunction)`, but that's not relevant to this question – Bergi Dec 16 '15 at 06:06
  • Thanks, I'll check out what "expand for details"means. – ZeroZerg Dec 18 '15 at 08:33

0 Answers0