如何获取原生javascript函数源代码? [英] How to get native javascript functions source code?

查看:779
本文介绍了如何获取原生javascript函数源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在控制台中,它显示为本机功能,但我想知道它们是如何构建的。例如,按空格键滚动页面时执行的代码是什么。这些信息会教会我很多,我可以使我的函数更有效

In console it appears as native function but I'd like to know how they were constructed. For example what is the code which executes when pressing space bar to scroll the page. That info would teach me a lot, and I could make my functions more effective

推荐答案

虽然这不会显示实际的源代码,如果您对实现了多少本地 JavaScript 函数感兴趣,可以仔细阅读它们所基于的规范:

While this will not show you actual source code, if you're interested in how many of the native JavaScript functions are implemented, you can peruse the specification upon which they are based:

标准ECMA-262

这篇关于如何获取原生javascript函数源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆