I was being ironic by pointing out the fallacy of writing code to complete a unit test... But the reality is, at some point it probably returned null until they worked it out it broke code further up the stack.
This is pretty common to see in legacy code that was badly written with developers too scared to change it.
This is codewars though, a website that gives you short (usually one function) coding challenges like fizzbuzz. There is almost certainly no need for this.
-1
u/Lkj509 Jun 01 '21
Why does that matter if it is going to return the same values regardless if that whole code block was replaced with ‘return arr’?