admin管理员组文章数量:1331616
I see parseInt() and parseFloat() when I hit TAB in the console.
I can just type:
parseInt('123asd');
But where are these located?
I see parseInt() and parseFloat() when I hit TAB in the console.
I can just type:
parseInt('123asd');
But where are these located?
Share Improve this question asked Nov 10, 2010 at 20:16 ajsieajsie 79.9k110 gold badges284 silver badges386 bronze badges 5- Which console are you referring to ? – Barry Commented Nov 10, 2010 at 20:17
- 1 They're located in your puter three bits to the left of the microprocessor...They're in the global scope if that's what you're asking. – zzzzBov Commented Nov 10, 2010 at 20:18
-
function parseInt() { [native code] }
– Josh Stodola Commented Nov 10, 2010 at 20:19 - @Barry: Chrome's console, but also Node.js. – ajsie Commented Nov 10, 2010 at 20:21
- 1 @zzzzBov They are in the global namespace. – Šime Vidas Commented Nov 10, 2010 at 20:28
2 Answers
Reset to default 8They are properties of the global object. (built-in functions)
In the case of the browser, this is window
.
parseInt and parseFloat are attached to the "Global" javascript object therefore they are available in all contexts.
本文标签: javascriptWhere are parseInt() and parseFloat() locatedStack Overflow
版权声明:本文标题:javascript - Where are parseInt() and parseFloat() located? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742257204a2441846.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论