javascript 如何在jslint中禁用此错误警告?[duplicate]

jchrr9hc  于 2022-12-28  发布在  Java
关注(0)|答案(1)|浏览(98)
    • 此问题在此处已有答案**:

JSLint: Unexpected 'for'. Unexpected 'var'(2个答案)
22小时前关门了。
有人能告诉我如何消除这个错误出现在jslint?
如何禁用它?
视频显示:https://jsfiddle.net/xrs21efw/
https://www.jslint.com/

function onYouTubeIframeAPIReady() {

    const totalP = document.querySelectorAll("[data-container=\"play1\"]");

    for (let i = 0; i < totalP.length; i++) {

        players.add(".playSingle" + i, (playerVarsList[i] || {}));
    }
    players.add(".playInitial", {});
}

polkgigr

polkgigr1#

请尝试以下操作:

totalP.forEach((_, index) => {
            players.add(".playSingle" + index, (playerVarsList[index] || {}));
    })

相关问题