Freecodecamp: Possible solution issue Project 180 freecodecamp

Created on 13 May 2018  路  10Comments  路  Source: freeCodeCamp/freeCodeCamp

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

All 10 comments

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.

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

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

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

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

@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

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

@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 :)

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

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

Was this page helpful?
0 / 5 - 0 ratings