Skip to content

var variable undefined #66

Open
Open
@boogie

Description

@boogie

It seems there is an issue related to var declarations:

function main() {
    var x = 'before';
    console.log(x);
    var x = 'after';
}
main();

The expected behaviour is printing "before", while it prints "undefined".

This code work as expected:

function main() {
    x = 'before';
    console.log(x);
    var x = 'after';
}
main();

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions