Javascript 为什么此函数从JSLint获取警告消息?
我有一个功能运行得非常好,但我仍然从JS Lint收到一条警告消息Javascript 为什么此函数从JSLint获取警告消息?,javascript,html5-canvas,jslint,Javascript,Html5 Canvas,Jslint,我有一个功能运行得非常好,但我仍然从JS Lint收到一条警告消息 function undoActionClick() { if (history.length <= 1) return; history.pop(); contextTmp.putImageData(history[history.length - 1], 0, 0);
function undoActionClick() {
if (history.length <= 1) return;
history.pop();
contextTmp.putImageData(history[history.length - 1], 0, 0);
updateHistorySelection();
}
函数撤消操作单击(){
if(history.length函数undoActionClick(){
if(history.length)您的linter正在抱怨单行if语句。请使用{}
将其包装或禁用该规则。