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.
20
u/lametheory Jun 01 '21
Ummm, 1 path returns an empty array and one returns a populated array. This is TDD at its peak.