Skip to content

Invalid example #13

@danwellman

Description

@danwellman

Hey there, in the Combined var declarations section, the bug that you illustrate through accidentally forgetting a comma in a list of combined variable declarations is easily avoided by using the 'use strict'; directive, which causes an Uncaught ReferenceError to be thrown rather than silently creating a global variable.

I agree that using combined or multiple var statements is a personal preference rather than a best-practice, but using strict mode wherever possible, definitely is a best practice :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions