Why does es6 not allow this? I understand that message is only defined in the alert module and is undefined in the base module, but I (apparently wrongly) imagine that since the alert class has access to it, all of the class should... Thoughts?
//file component.js
import Base from './base';
const message = "hello";
class Alert extends Base {
initialize() {
this.render();
}
}
export default Alert;
and
//file base.js
class Base {
render() {
alert(message);
}
}
export default Base;