Skip to content

Operations on Numbers & Strings #542

Closed
@wassimans

Description

@wassimans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions