Freecodecamp: Using typeof challenge requires semicolons to be correct

Created on 28 Dec 2017  ·  3Comments  ·  Source: freeCodeCamp/freeCodeCamp

Challenge Name

Using typeof

Issue Description

In the Using typeof challenge, if one were to submit:

console.log(typeof "")

console.log(typeof 0)

console.log(typeof [])

console.log(typeof {})

However, if semicolons were added:

console.log(typeof "");

console.log(typeof 0);

console.log(typeof []);

console.log(typeof {});

Then all the tests are passed. Javascript does not require semicolons therefore this is simply complicating the challenge for users who do not use semicolons.


screenshot 2017-12-28 at 11 51 18 am

first timers only help wanted

Most helpful comment

I submitted a PR for this. It should now work as intended.

All 3 comments

Thanks for reporting this bug @ChrisBrownie55!

The challenge has been removed in the beta, but there is still a challenge about typeof. It also requires a semicolon. We don't need to enforce that here.

What needs to be changed

You can find the code here:

Removing the semicolon from the regular expression there should do the trick.

Check out to get your local development environment set up.

If you need help, please go to our contributors chatroom. We're always happy to answer any questions!

I submitted a PR for this. It should now work as intended.

Thanks @ncaron!

Was this page helpful?
0 / 5 - 0 ratings