Manipulate Arrays With unshift
https://www.freecodecamp.com/challenges/manipulate-arrays-with-unshift
The code doesn't check for the case entered for the array output.
The test isn't very picky about the contents, is it? Even myArray.unshift(['paul','35']);
passes, with the string '35'
rather than the number 35
.
The important part is that unshift
is used correctly, which the test does check for. Still, the value indicated as correct for myArray
probably should more closely match what is actually tested for.
Edited to add: The other neighboring array manipulation challenges (push/pop/shift) do not include the toLowerCase()
in their tests which this challenge includes, so this is the odd one out in that regard. The others do also have loose equality for number values, however, so string forms of numbers are acceptable in each.
I totally understand that but if the Cases are checked for most of the results then why not this, sure this one is odd but consistency is key. Thanks though
@Akshit-p Oh, I'm not disagreeing with you, just adding more information 馃槃
I think the test for this challenge should be changed to remove the toLowerCase()
, but I also think tests in all four of the challenges should use strict number comparison to ensure users are entering the correct values.
Most helpful comment
@Akshit-p Oh, I'm not disagreeing with you, just adding more information 馃槃
I think the test for this challenge should be changed to remove the
toLowerCase()
, but I also think tests in all four of the challenges should use strict number comparison to ensure users are entering the correct values.