4

Possible Duplicate:
Is Chrome's JavaScript console lazy about evaluating arrays?

For this annonymous function I have diferent output, and it depends if I am using Chrome developer console or Firefox Firebug.Why is that ?

(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
Community
  • 1
  • 1
Miroslav Trninic
  • 3,327
  • 4
  • 28
  • 51
  • 1
    possible duplicate of [Is Chrome's JavaScript console lazy about evaluating arrays?](http://stackoverflow.com/questions/4057440/is-chromes-javascript-console-lazy-about-evaluating-arrays) and [Apparently contradictory behavior of Javascript function](http://stackoverflow.com/questions/7377853/apparently-contradictory-behavior-of-javascript-function) and probably others. – Felix Kling May 12 '12 at 18:23
  • As mentioned in the accepted answer of the first question I linked to, this is a disputed bug: https://bugs.webkit.org/show_bug.cgi?id=35801 – Felix Kling May 12 '12 at 18:27
  • You can either delete your question or flag it and ask moderator to close/delete it. – Felix Kling May 12 '12 at 18:28
  • Done - it can be treated as duplicate. – Miroslav Trninic May 12 '12 at 18:31
  • @Felix - I don't think it should be deleted. Just closed. Closing it will serve as another inbound link to the other question and will be a breadcrumb to help other users find answers to this or a similar question. Questions should really only be deleted if they are not useful, grossly off-topic, spam, etc. See http://meta.stackexchange.com/questions/105601/when-should-a-closed-question-be-flagged-for-deletion for more details and examples of questions that should be deleted. – jamesmortensen May 12 '12 at 19:00

0 Answers0