我有使用spread(...)
的代码,而我的jshint在其下划线标明:
'对象传播属性'仅在ES9中可用(使用'esversion:9')。 (W119)jshint(W119)
var morning = {
breakfast: "oatmeal",
lunch: "peanut and jelly",
eat() {
console.log("will eat later");
}
};
var dinner = "mac and chees";
var backpackingMeals = {
...morning,
dinner
};
console.log(backpackingMeals);
答案 0 :(得分:0)
尝试在行之前和之后添加以下注释:
/*jshint -W119*/
//your line goes here
/*jshint +W119*/