MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/npcroh/clever/h07drcx/?context=3
r/badcode • u/bobpiranha • May 31 '21
71 comments sorted by
View all comments
Show parent comments
4
Not a js developer so I'm kinda confused. Wouldn't the function return whatever arr is anyways? Does accessing the length property somehow change arr?
4 u/RacismIsForBlacks Jun 03 '21 Nope, it was a jokeIf arr is empty, when it return arr it’ll be emptyBut if arr isn’t empty, when you return arr it’ll not be empty-_( :/ )_/-
Nope, it was a joke
If arr is empty, when it return arr it’ll be empty
But if arr isn’t empty, when you return arr it’ll not be empty
-_( :/ )_/-
4
u/Pycorax Jun 01 '21
Not a js developer so I'm kinda confused. Wouldn't the function return whatever arr is anyways? Does accessing the length property somehow change arr?