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?
- 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
1 Answer
Reset to default 6No, there's no difference, as both literals are parsed into the same primitive number.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744882594a4598927.html
评论列表(0条)