Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case check not done for the result #9806

Closed
Akshit-p opened this issue Jul 20, 2016 · 3 comments
Closed

Case check not done for the result #9806

Akshit-p opened this issue Jul 20, 2016 · 3 comments
Labels
help wanted Open for all. You do not need permission to work on these.

Comments

@Akshit-p
Copy link

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

@BKinahan
Copy link
Contributor

BKinahan commented Jul 20, 2016

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.

@Akshit-p
Copy link
Author

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

@BKinahan
Copy link
Contributor

@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.

@raisedadead raisedadead added enhancement help wanted Open for all. You do not need permission to work on these. labels Jul 20, 2016
@ghost ghost closed this as completed in #9881 Jul 25, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these.
Projects
None yet
Development

No branches or pull requests

3 participants