3 ms·
You definitely want to add test cases for arrays with mixed-type values and for non-arrays. Yeah, the latter should be caught by an isArray() check... which is
by Beldin 4y ago
You definitely want to add test cases for arrays with mixed-type values and for non-arrays.
Yeah, the latter should be caught by an isArray() check... which is the whole point.
- tialaramex 4y agoAs I understand it this was a multilingual exercise. In some languages "mixed type values" isn't a thing so you can't test it and your users can't get it wrong. Likewise for non-arrays. It's notable that one of the participants had decided empty arrays shouldn't be a thing, so far as I know programming languages all admit the idea of the empty array although perhaps some of them don't distinguish between empty arrays and various other empty data structures.