"如何使用表达式的方法定义函数,又能在定义之前调用", 这个今天写项目遇到偶然发现了,翻面经回来评论一下。 应该是ESModule模块中有这个特性吧, 还得要是eport的函数中(例如下面的print)才能调用。 export const print=()=>{ test(); } const test = () => { console.log('test'); hello(); } const hello = () => { console.log('hello'); }