Chrome and firefox javascript console - another return value

Possible duplicate:
Is the Chrome JavaScript console lazy about evaluating arrays?

For this anonymous function, I have a different result, and it depends on whether I use the Chrome developer console or Firefox Firebug. Why is this?

(function(){ var t =["one","two"]; console.log(t) function a(m){ t[2]="three"; console.log(t) };a(t) function b(n){ t[3]="four"; console.log(t) };b(t) }()) ["one", "two", "three", "four"] ["one", "two", "three", "four"] ["one", "two", "three", "four"] // chrome output ["one", "two"] ["one", "two", "three"] ["one", "two", "three", "four"]// firebug output 
+4
source share

Source: https://habr.com/ru/post/1412176/


All Articles