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

Object constructor argument of spacing #10405

Closed
babygoat opened this issue Aug 31, 2016 · 1 comment
Closed

Object constructor argument of spacing #10405

babygoat opened this issue Aug 31, 2016 · 1 comment
Labels
help wanted Open for all. You do not need permission to work on these.

Comments

@babygoat
Copy link

babygoat commented Aug 31, 2016

Challenge Name

https://www.freecodecamp.com/challenges/get-json-with-the-jquery-getjson-method

Issue Description

Hello, I'm newbie to the javascript. I used to write C or C++ so I adapted several coding styles from them. The issue I encountered was if I left space between the argument and the parenthesis, I would fail the last requirement ("Don't forget to ...") of the challenge. I knew it might not be a good practice to adopt the style but I was wondering why it would fail the test. So far, I haven't found any related information. Thanks for your consideration.

Browser Information

  • Browser Name, Version: Chrome, 52.0.2743.116
  • Operating System: Windows 7
  • Mobile, Desktop, or Tablet: Laptop

Your Code

/* Incorrect */
       $.getJSON("/json/cats.json", function( json ) {
                $(".message").html( JSON.stringify(json) );
                });
/* Correct */
       $.getJSON("/json/cats.json", function(json) {
                $(".message").html( JSON.stringify(json) );
                }); 

Screenshot

issue

@dhcodes
Copy link
Contributor

dhcodes commented Sep 3, 2016

@babygoat Sorry for the delay. This has come up before in similar challenges (ex. #10021 and #8360). It's a matter of updating the Regex tests to accept optional spaces because as you've mentioned, it is acceptable. Thanks for the issue.

@dhcodes dhcodes added the help wanted Open for all. You do not need permission to work on these. label Sep 3, 2016
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

2 participants