Skip to content

Instantly share code, notes, and snippets.

@GooseNinja
Last active February 22, 2017 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GooseNinja/175c448113259808d8115a68f7dffb39 to your computer and use it in GitHub Desktop.
Save GooseNinja/175c448113259808d8115a68f7dffb39 to your computer and use it in GitHub Desktop.
for (let i = 0; i < 10; i++) {
console.log(i);
}
// Error
console.log('360 no-scope', i);
for (var i = 0; i < 10; i++) {
console.log(i);
}
console.log('360 no-scope', i);
@loktacar
Copy link

viktoralex@tuvok java_test $ cat Test.java

public class Test
{
    public static void main(String[] args)
    {
        for (int i = 0; i < 10; i++)
        {
            System.out.println(i);
        }

        System.out.println("360 no scope: " + i);
    }
}

viktoralex@tuvok java_test $ javac Test.java

        System.out.println("360 no scope: " + i);
                                              ^
  symbol:   variable i
  location: class Test
1 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment