Skip to content

Function as Variable Init But no Def #6

@definiteconfusion

Description

@definiteconfusion

Description

If I use a function, when it compiles to js, it init[s] the function name as a variable but never gives a value. So, when the script is run, you get an error because the variable (with the name of the function) was initialized and left at that. I assume it automatically creates a new variable when ever there is a "name = " and so it sees the "name = " in "name = ()" and just doesn't check if there are "()" after the " = ".

Code

var example; example = function() { // //FUNCTION CODE // };

Error

ReferenceError: Can't find variable: example 

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