How does console.log work?

后端 未结 4 690
清歌不尽
清歌不尽 2021-02-04 08:22

First Example:

In the following example: http://jsfiddle.net/maniator/ScTAW/4/
I have this js:

var storage = (function () {
    var store = [];
            


        
4条回答
  •  天涯浪人
    2021-02-04 08:56

    Your storage adding function is completely evaluated before console.log is called because it's a parameter.

    This is not specific to console.log, this is how every imperative programming language works.

提交回复
热议问题