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

Possible solution issue Project 180 freecodecamp #17155

Closed
Daniel-Michael opened this Issue May 13, 2018 · 10 comments

Comments

Projects
None yet
4 participants
@Daniel-Michael

Daniel-Michael commented May 13, 2018

Challenge Name

Introducing else if statements

link to challenge

https://www.freecodecamp.org/challenges/introducing-else-if-statements

Issue Description

I believe there is a missing parentheses after the second else statement which should not pass the test, however it currently does.

If you see the screenshots attached, without the closing parenthese the code passes, but add it in as per the example code and it won't pass the test.

Browser Information

  • Browser Name, Version: Chrome 4.3
  • Operating System: Android
  • Mobile, Desktop, or Tablet: Tablet

Your Code

function testElseIf(val) {
  if (val > 10) {
    return "Greater than 10";
  } else if (val < 5) {
    return "Smaller than 5";
  } else 
  
  return "Between 5 and 10";
}

// Change this value to test
testElseIf(7);

Screenshot

screenshot_20180513-101907

screenshot_20180513-101927

@rsangdoung

This comment has been minimized.

rsangdoung commented May 13, 2018

I would like to be assigned to fix/contribute to this issue. I'm still new so I'm not sure if I'm doing this correctly.

@Daniel-Michael

This comment has been minimized.

Daniel-Michael commented May 14, 2018

@rsangdoung I'd like to accept but I don't know how to assign you.

@Bouncey

This comment has been minimized.

Member

Bouncey commented May 17, 2018

Is this a bug or is it just a weird JavaScript thing?

if (someCondition) return foo;

Is valid JavaScript, I wouldn't be surprised if the block-less else is as well

@QuincyLarson

This comment has been minimized.

Contributor

QuincyLarson commented Jun 3, 2018

@Daniel-Michael I agree that we need a curly brace after the else statement.

@rsangdoung Were you able to figure out how to get freeCodeCamp running locally so you can go in and fix it?

@rsangdoung

This comment has been minimized.

rsangdoung commented Jun 3, 2018

@QuincyLarson I have forked the repo and created a new branch called "fix/#17155". It looks like I'm ready to fix it.

@QuincyLarson

This comment has been minimized.

Contributor

QuincyLarson commented Jun 16, 2018

@rsangdoung Thanks for your patience. Have you had time to work on this? Once you have successfully forked freeCodeCamp, created a branch, and fixed the issue, you can open a pull request. We have additional details on how to do this in https://github.com/freeCodeCamp/freeCodeCamp/blob/staging/CONTRIBUTING.md

@rsangdoung

This comment has been minimized.

rsangdoung commented Jun 16, 2018

@QuincyLarson I haven't had much success in resolving the seeding issue and my http://localhost:3000 is not functioning properly. I think you should give it to someone else because I'm not much help at this point. It's okay. Thank you.

@QuincyLarson

This comment has been minimized.

Contributor

QuincyLarson commented Jun 21, 2018

@rsangdoung OK - no worries. I've added the help wanted label. Anyone who's looking for a curriculum-focused issue to help out with, this is a good one :)

@ghost

This comment has been minimized.

ghost commented Aug 12, 2018

@QuincyLarson I would like to work (fix) on this issue if nobody is working on it currently.

@QuincyLarson

This comment has been minimized.

Contributor

QuincyLarson commented Aug 18, 2018

@devocija-it OK - sounds great! I've added the in-progress label and am looking forward to seeing your fix for this!

@ghost ghost referenced this issue Aug 21, 2018

Merged

fix(challenges): fix regex in introducing else if challenge #262

7 of 7 tasks complete

ValeraS pushed a commit to ValeraS/freeCodeCamp that referenced this issue Oct 12, 2018

fix(challenges): fix freeCodeCamp#17155
i've added a test for if else statements curly braces to ensure that every condition has to have
both opening and closing curly braces.

I've also made changes that were by scissorsneedfood.

ISSUES CLOSED: freeCodeCamp#17155

ValeraS pushed a commit to ValeraS/freeCodeCamp that referenced this issue Oct 12, 2018

chore(release): 3.2.0 [skip ci]
# [3.2.0](freeCodeCamp/curriculum@v3.1.2...v3.2.0) (2018-09-20)

### Bug Fixes

* **challenges:** a sentence didn't make sense, so I modified it ([3d77920](freeCodeCamp/curriculum@3d77920)), closes [freeCodeCamp#18046](https://github.com/freeCodeCamp/curriculum/issues/18046)
* **challenges:** add missing test to check for for css class ([6e42f53](freeCodeCamp/curriculum@6e42f53)), closes [freeCodeCamp#254](freeCodeCamp/curriculum#254)
* **challenges:** add note at bottom of description in d3 challenge ([c60d332](freeCodeCamp/curriculum@c60d332)), closes [freeCodeCamp#17767](https://github.com/freeCodeCamp/curriculum/issues/17767)
* **challenges:** add solution, test to project euler problems ([f572324](freeCodeCamp/curriculum@f572324))
* **challenges:** add solutions to first 3 debugging challenges ([c2e5794](freeCodeCamp/curriculum@c2e5794))
* **challenges:** add test to check user is using \W in Regex ([296cf44](freeCodeCamp/curriculum@296cf44))
* **challenges:** add test to lookahead regex challenge ([e044de4](freeCodeCamp/curriculum@e044de4)), closes [freeCodeCamp#209](freeCodeCamp/curriculum#209)
* **challenges:** added code tags ([065036b](freeCodeCamp/curriculum@065036b)), closes [freeCodeCamp#18054](https://github.com/freeCodeCamp/curriculum/issues/18054)
* **challenges:** added solutions to project euler problems 28, 31 ([5e12499](freeCodeCamp/curriculum@5e12499))
* **challenges:** adding code tags to description ([57d5b55](freeCodeCamp/curriculum@57d5b55)), closes [freeCodeCamp#17911](https://github.com/freeCodeCamp/curriculum/issues/17911)
* **challenges:** adding negative integer to challenge to improve tests ([freeCodeCamp#211](freeCodeCamp/curriculum#211)) ([2adc516](freeCodeCamp/curriculum@2adc516))
* **challenges:** allow user to comment out undesired code ([72c2407](freeCodeCamp/curriculum@72c2407))
* **challenges:** challenge description is formatted and concised ([dcd8e45](freeCodeCamp/curriculum@dcd8e45))
* **challenges:** change challengeType to fix help button ([ddcc661](freeCodeCamp/curriculum@ddcc661))
* **challenges:** change definition of complementary colors ([freeCodeCamp#299](freeCodeCamp/curriculum#299)) ([c022dff](freeCodeCamp/curriculum@c022dff))
* **challenges:** check for shorthand character in regex ([freeCodeCamp#238](freeCodeCamp/curriculum#238)) ([0bf8d32](freeCodeCamp/curriculum@0bf8d32))
* **challenges:** commented output was wrong ([3cb972e](freeCodeCamp/curriculum@3cb972e))
* **challenges:** converts delete html test to regex ([d80d98d](freeCodeCamp/curriculum@d80d98d)), closes [freeCodeCamp#251](freeCodeCamp/curriculum#251)
* **challenges:** corrected challenge instructions ([159203a](freeCodeCamp/curriculum@159203a))
* **challenges:** fix [freeCodeCamp#17155](https://github.com/freeCodeCamp/curriculum/issues/17155) ([cb21e59](freeCodeCamp/curriculum@cb21e59))
* **challenges:** fix confusing destructuring es6 challenge ([1a4f6a8](freeCodeCamp/curriculum@1a4f6a8)), closes [freeCodeCamp#213](freeCodeCamp/curriculum#213)
* **challenges:** fix description in css variable fallback challenge ([bc33a03](freeCodeCamp/curriculum@bc33a03)), closes [freeCodeCamp#17546](freeCodeCamp#17546)
* **challenges:** fix flex direction row regex ([25ea07e](freeCodeCamp/curriculum@25ea07e)), closes [freeCodeCamp#260](freeCodeCamp/curriculum#260)
* **challenges:** fix grammar and spelling errors ([freeCodeCamp#244](freeCodeCamp/curriculum#244)) ([b0c0b74](freeCodeCamp/curriculum@b0c0b74))
* **challenges:** fix grid-gap shorthand regex ([freeCodeCamp#232](freeCodeCamp/curriculum#232)) ([a49f45e](freeCodeCamp/curriculum@a49f45e)), closes [freeCodeCamp#229](freeCodeCamp/curriculum#229)
* **challenges:** fix grid-gap shorthand regex ([freeCodeCamp#237](freeCodeCamp/curriculum#237)) ([b369fa0](freeCodeCamp/curriculum@b369fa0)), closes [freeCodeCamp#229](freeCodeCamp/curriculum#229)
* **challenges:** fix regex in a JS challenge ([freeCodeCamp#257](freeCodeCamp/curriculum#257)) ([6058da3](freeCodeCamp/curriculum@6058da3))
* **challenges:** fix typo in wrap-reverse description ([434ea5c](freeCodeCamp/curriculum@434ea5c))
* **challenges:** fixed challenge accepted without any new code ([96b39c1](freeCodeCamp/curriculum@96b39c1)), closes [freeCodeCamp#198](freeCodeCamp/curriculum#198)
* **challenges:** fixed esc chars in managing packages with npm lesson ([6335a15](freeCodeCamp/curriculum@6335a15))
* **challenges:** fixed tests to check for pre operators ([ded4705](freeCodeCamp/curriculum@ded4705)), closes [freeCodeCamp#199](freeCodeCamp/curriculum#199)
* **challenges:** fixed typo in algorithms and ds ([31957a4](freeCodeCamp/curriculum@31957a4))
* **challenges:** Incorrect html closing tag ([a1464f0](freeCodeCamp/curriculum@a1464f0))
* **challenges:** insufficient objectives for javascript_algorithm/es6/19 ([7707b18](freeCodeCamp/curriculum@7707b18))
* **challenges:** missing space in code example ([c50cc4e](freeCodeCamp/curriculum@c50cc4e))
* **challenges:** remove race condition from react lifecycle challenge ([a20ac56](freeCodeCamp/curriculum@a20ac56))
* **challenges:** removed duplicate css top property ([0a79c58](freeCodeCamp/curriculum@0a79c58))
* **challenges:** rephrased wording in applied visual design ([freeCodeCamp#268](freeCodeCamp/curriculum#268)) ([d560d58](freeCodeCamp/curriculum@d560d58))
* **challenges:** replaced em tags with code tags ([68daaf7](freeCodeCamp/curriculum@68daaf7)), closes [freeCodeCamp#18048](https://github.com/freeCodeCamp/curriculum/issues/18048)
* **challenges:** reword test text and improve test accuracy ([f834a98](freeCodeCamp/curriculum@f834a98))
* **challenges:** small edit to correct sematic issues ([322bf80](freeCodeCamp/curriculum@322bf80))
* clickjacking challenge description ([037990c](freeCodeCamp/curriculum@037990c))
* **challenges:** spelling and grammar errors addressed ([8f17adf](freeCodeCamp/curriculum@8f17adf))
* **challenges:** typo ([4f7faba](freeCodeCamp/curriculum@4f7faba))
* **challenges:** update test and add solution for DS challenge ([d1b2075](freeCodeCamp/curriculum@d1b2075)), closes [freeCodeCamp#164](freeCodeCamp/curriculum#164)
* **challenges:** Update test to include whitespace ([freeCodeCamp#272](freeCodeCamp/curriculum#272)) ([77689f4](freeCodeCamp/curriculum@77689f4)), closes [freeCodeCamp#271](freeCodeCamp/curriculum#271)
* **schema:** change schema and unpack script ([b014b23](freeCodeCamp/curriculum@b014b23))

### Features

* **challenges:** add browser fallback challenge ([b090e8b](freeCodeCamp/curriculum@b090e8b)), closes [freeCodeCamp#17546](freeCodeCamp#17546)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment