Why is my JavaScript function sometimes “not defined”?

后端 未结 13 1923
逝去的感伤
逝去的感伤 2020-12-24 01:18

I call my JavaScript function. Why do I sometimes get the error \'myFunction is not defined\' when it is defined?

For example. I\'ll occasionally g

13条回答
  •  孤城傲影
    2020-12-24 01:53

    If you're changing the prototype of the built-in 'function' object it's possible you're running into a browser bug or race condition by modifying a fundamental built-in object.

    Test it in multiple browsers to find out.

提交回复
热议问题