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

相关推荐

SadnessAlex:跟三十五岁原则一样,人太多给这些***惯坏了
点赞 评论 收藏
分享
牛客网
牛客企业服务