I know it was touched on a recent thread
(https://esdiscuss.org/topic/a-new-es6-draft-rev28), but is there a
reason why class declarations aren't hoisted like function
declarations? It is a little confusing to be to type (1) but not (2).

(1)
```js
foo(); // prints "Yay!"

function foo() {
  console.log('Yay!');
}
```

(2)
```js
new Foo().speak(); // Error

class Foo {
  constructor() {}

  speak() {
    console.log('Yay!');
  }
}
```

-- 
Isiah Meadows
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to