Quantcast
Channel: Uncategorized
Viewing all articles
Browse latest Browse all 8

Observation: `import` is hoisted

$
0
0

Axel Rauschmayer wrote:

Insight of the day: import is hoisted (due to ModuleDeclarationInstantiation). That’s why the following code works.

bar();

import {foo} from 'mymodule';

function bar() { // hoisted!
    foo(); // already initialized?
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8

Trending Articles