Calling toString on a javascript function returns source code

前端 未结 6 1274
梦如初夏
梦如初夏 2020-12-14 06:06

I just found out that when you call toString() on a javascript function, as in myFunction.toString(), the source code of that function is returned.

If y

6条回答
  •  庸人自扰
    2020-12-14 06:45

    A nice use case is remoting. Just toString the function in the client, send it over the wire and execute it on the server.

提交回复
热议问题