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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742257205a4410239.html
评论列表(0条)