8000 Variable cannot accessed from a closure function called from `setTimeout`. · Issue #10 · unvell/ReoScript · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Variable cannot accessed from a closure function called from setTimeout. #10
Open
@jingwood

Description

@jingwood

Variable cannot accessed from a closure function called from setTimeout.

Related to #1

function abc() {
  var b = 20;
  
  return (function(){
    setTimeout(_ => console.log("b = " + b), 1000);
  })();
}

abc();

Current result

b = undefined

Expected result

b = 20

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0