Hey, Can you test the below For loop? I guess it will give you slightly better performance.
let i=0; for(; i<10000000000;i++){ count += i }
The code is not correct can you please write it correctly
I'm not sure where you're struggling. The error message is quite telling, in that all that's missing is:
- let i=0; + let i=0, count;
Then the snippet runs. Though my quick look over it seems to make it benchmark slower than the for-scoped version, which is a bit surprising.
for
Yeah got it
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, Can you test the below For loop? I guess it will give you slightly better performance.
The code is not correct can you please write it correctly
I'm not sure where you're struggling. The error message is quite telling, in that all that's missing is:
Then the snippet runs. Though my quick look over it seems to make it benchmark slower than the
for
-scoped version, which is a bit surprising.Yeah got it