JavaScript performance difference with time(int) declaration? - Stack Overflow

What it is the difference in having:setInterval(function(){},5000);and:setInterval(function(){},5E3);I

What it is the difference in having:

setInterval(function(){

},5000);

and:

setInterval(function(){

},5E3);

I know that 5E3 is like saying 5*1000 but is there is any benefits one from another way to declare times?

What it is the difference in having:

setInterval(function(){

},5000);

and:

setInterval(function(){

},5E3);

I know that 5E3 is like saying 5*1000 but is there is any benefits one from another way to declare times?

Share asked Aug 13, 2013 at 8:56 Jorge Y. C. RodriguezJorge Y. C. Rodriguez 3,4495 gold badges41 silver badges63 bronze badges 2
  • 5 The major difference is readability. Every developer would immediately know that the first one is 5 seconds while some thinking may be involved with the second one. Don't obfuscate your code in this way as you make it less maintainable. – Robert Koritnik Commented Aug 13, 2013 at 9:07
  • why minifier do 50000 to 5e3, just less file size ? – inrsaurabh Commented Feb 7, 2019 at 7:16
Add a ment  | 

1 Answer 1

Reset to default 6

No, there's no difference, as both literals are parsed into the same primitive number.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744882594a4598927.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

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

关注微信