Can you alter a Javascript function after declaring it?

前端 未结 12 825
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 22:10

Let\'s say I have var a = function() { return 1; }. Is it possible to alter a so that a() returns 2? Perhaps by editing a

12条回答
  •  一个人的身影
    2020-11-28 22:48

    If you're debugging javascript and want to see how changes to the code affects the page, you can use this Firefox extension to view/alter javascripts:

    Execute JS firefox extension: https://addons.mozilla.org/en-US/firefox/addon/1729

提交回复
热议问题