Freecodecamp: Case check not done for the result

Created on 20 Jul 2016  路  3Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Name

Manipulate Arrays With unshift

https://www.freecodecamp.com/challenges/manipulate-arrays-with-unshift

Issue Description

The code doesn't check for the case entered for the array output.

Browser Information

  • Google Chrome, Version: 51.0.2704.106 m
  • Operating System: Windows 10 Home
  • Mobile, Desktop, or Tablet:

Your Code


Screenshot

image

help wanted

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings