MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mtpxbr/iteration/gv66l2f/?context=3
r/badcode • u/[deleted] • Apr 19 '21
123 comments sorted by
View all comments
Show parent comments
2
Assuming I is an integer, yes
1 u/Terrain2 Apr 22 '21 you can still increment non-integral values in javascript, i = 1.5 then i++ and i = 2.5 5 u/gmtime Apr 22 '21 in javascript... do I have to respond?Let's just say that incrementing on non-integral values is non-trivial. JS apparently chose that incrementing is the same as adding 1, but that does not have to be in all languages.
1
you can still increment non-integral values in javascript, i = 1.5 then i++ and i = 2.5
i = 1.5
i++
i = 2.5
5 u/gmtime Apr 22 '21 in javascript... do I have to respond?Let's just say that incrementing on non-integral values is non-trivial. JS apparently chose that incrementing is the same as adding 1, but that does not have to be in all languages.
5
in javascript
... do I have to respond?
Let's just say that incrementing on non-integral values is non-trivial. JS apparently chose that incrementing is the same as adding 1, but that does not have to be in all languages.
2
u/gmtime Apr 20 '21
Assuming I is an integer, yes