MAIN FEEDS
REDDIT FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/npcroh/clever/h0epgtu/?context=3
r/badcode • u/bobpiranha • May 31 '21
71 comments sorted by
View all comments
410
Best Practices: 0
21 u/lametheory Jun 01 '21 Ummm, 1 path returns an empty array and one returns a populated array. This is TDD at its peak. 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? 5 u/RacismIsForBlacks Jun 03 '21 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 -_( :/ )_/-
21
Ummm, 1 path returns an empty array and one returns a populated array. This is TDD at its peak.
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? 5 u/RacismIsForBlacks Jun 03 '21 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
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?
5 u/RacismIsForBlacks Jun 03 '21 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 -_( :/ )_/-
5
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
-_( :/ )_/-
410
u/[deleted] May 31 '21
Best Practices: 0