輸出文は構文エラーES6/7で矢印機能をエクスポートすることはできますか?以下
export default const hello =() => console.log("say hello")
理由を与えますか?
私は唯一の理由は何という名前の関数
export function hello() {
console.log("hello")
}
をエクスポートすることができますよ!
輸出文は構文エラーES6/7で矢印機能をエクスポートすることはできますか?以下
export default const hello =() => console.log("say hello")
理由を与えますか?
私は唯一の理由は何という名前の関数
export function hello() {
console.log("hello")
}
をエクスポートすることができますよ!
Is it possible to export Arrow functions in ES6/7?
はい。 export
は、エクスポートする値を気にしません。
The export statement below gives a syntax error ... why?
あなたは(「デフォルト」は、すでに輸出の名前です)、それを名前を与えるデフォルト輸出とを持つことはできません。
のどちらかが
export default() => console.log("say hello");
または
const hello =() => console.log("say hello");
export default hello;
エラーが実際に何を言うんですか? – Andy
ここでうまく動作します:http://astexplorer.net/#/0fv5UXttsP。 –
ここをクリックしてください:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export – John