写js的时候遇到个尴尬的小错误,给自己一个嘴巴子。。。。
错误的翻译大概是 期望一个方法名,就是说我的方法名不符合规范,所以应该是使用了关键字导致的
我的错误:
改正后 错误就没有了
所以要小心不能把关键字、保留字、true、false和null用作标识符。
js的关键字:delete、break、else、new、var、case、finally、return、void、catch、for、switch、while、continue、function、this、with、default、if、throw、in、try、do、instranceof、typeof。
js的保留字:abstract、enum、int、short、boolean、export、interface、static、byte、extends、long、super、char、final、native、synchronized、class、float、package、throws、const、goto、private 、transient、debugger、implements、protected 、volatile、double、import、public。