JavaScript console prints assigned value of variable before it has been assigned?

后端 未结 8 786
Happy的楠姐
Happy的楠姐 2020-12-06 17:47

I\'m deeply confused by the behaviour of either JavaScript, or the Chrome console. Can someone help me understand?

Basically I have the following JavaScript code, no

8条回答
  •  天命终不由人
    2020-12-06 18:00

    console.log("COPIED 1", JSON.stringify(copied_array));

    Should be fine for debugging


    it's a BUG you have mentioned, see below

    https://bugs.webkit.org/show_bug.cgi?id=35801

    also read similar questions

    Is Chrome's JavaScript console lazy about evaluating arrays?

    Bizarre console.log behaviour in Chrome Developer Tools

    Why does javascript object show different values in console in Chrome, Firefox, Safari?

提交回复
热议问题