Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Huuugo25207y@LeoRiether @nyxmc only because you can doesn't mean you should! Your one-liners take double the time to read, are hard to extend and are very error-prone.
-
Wait what?
Where is sheep array defined prior to calling length on it? Also like others mentioned why run out of sheep by having a finite number.
Also why start two counters at 0 just to increment them both at the same rate numberOfSheeps will always be equal to i in which case using i in the loop is pointless. -
That loop is not optimized.
Tell him to use ++i instead of i++ to avoid creating one unnecessary object
Coming out the test today. There is a message from the Professor in the back of the test.
undefined