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

Using typeof challenge requires semicolons to be correct #16359

Closed
andria-dev opened this issue Dec 28, 2017 · 3 comments
Closed

Using typeof challenge requires semicolons to be correct #16359

andria-dev opened this issue Dec 28, 2017 · 3 comments
Labels
first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. help wanted Open for all. You do not need permission to work on these.

Comments

@andria-dev
Copy link

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

screenshot 2017-12-28 at 11 51 18 am

@systimotic systimotic added first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. help wanted Open for all. You do not need permission to work on these. labels Dec 28, 2017
@systimotic
Copy link
Member

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:

"assert(code.match(/console\\.log\\(typeof[\\( ].*\\)?\\);/g).length == 2, 'message: Your code should use <code>typeof</code> in two <code>console.log()</code> statements to check the type of the variables.');",

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

Check out CONTRIBUTING.md 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!

@ncaron
Copy link
Contributor

ncaron commented Dec 29, 2017

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

@systimotic
Copy link
Member

Thanks @ncaron!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. 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