Difference between setTimeout with and without quotes and parentheses

前端 未结 6 1249
甜味超标
甜味超标 2020-11-22 07:06

I am learning JavaScript and I have learned recently about JavaScript timing events. When I learned about setTimeout at W3Schools, I noticed a strange figure wh

6条回答
  •  太阳男子
    2020-11-22 07:42

    Totally agree with Joseph.

    Here is a fiddle to test this: http://jsfiddle.net/nicocube/63s2s/

    In the context of the fiddle, the string argument do not work, in my opinion because the function is not defined in the global scope.

提交回复
热议问题