Skip to content

Operations on Numbers & Strings #542

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

Closed
wassimans opened this issue Jul 30, 2014 · 2 comments
Closed

Operations on Numbers & Strings #542

wassimans opened this issue Jul 30, 2014 · 2 comments

Comments

@wassimans
Copy link

In the "Operations on Numbers & Strings" at (http://learn.jquery.com/javascript-101/operators/); the comment after the console.log in the following code is misleading to novice programmers:


// Addition vs. Concatenation
var foo = 1;
var bar = "2";
console.log( foo + bar ); // 12

because it doesn't show that 12 is actually a string. So, surrounding 12 with quotes or better, just mentioning that 12 is a string; will make the concept simple to grasp.

@AurelioDeRosa
Copy link
Member

I agree with this proposal.

@arthurvr
Copy link
Member

arthurvr commented Dec 6, 2014

I opened a PR for this: #581

@gnarf gnarf closed this as completed in dd6c3bb Dec 23, 2014
arthurvr added a commit to arthurvr/learn.jquery.com that referenced this issue Jan 4, 2015
Adding quote around an console.log output clarifies that it's
actually a string. In this article this really makes sense.

Closes jquerygh-581
Fixes jquerygh-542
Krinkle pushed a commit that referenced this issue Apr 9, 2024
Adding quote around an console.log output clarifies that it's
actually a string. In this article this really makes sense.

Closes gh-581
Fixes gh-542
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants