javascript - Where are parseInt() and parseFloat() located? - Stack Overflow

I see parseInt() and parseFloat() when I hit TAB in the console.I can just type:parseInt('123asd&#

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
Add a ment  | 

2 Answers 2

Reset to default 8

They 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信