From f56ab9d85714e5e3fcdb52a8819cf19449893e9c Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Fri, 1 Dec 2023 09:17:15 +0800 Subject: [PATCH] =?UTF-8?q?Array#remove=E6=94=AF=E6=8C=81=E7=A7=BB?= =?UTF-8?q?=E9=99=A4NaN=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 7ddfb6cb8..a4fd02871 100644 --- a/game/game.js +++ b/game/game.js @@ -9022,7 +9022,12 @@ new Promise(resolve=>{ writable:true, value:function(){ for(const item of arguments){ - const pos=this.indexOf(item); + let pos=-1; + if (typeof item=='number'&&isNaN(item)){ + pos=this.findIndex(v=>isNaN(v)) + }else{ + pos=this.indexOf(item); + } if(pos==-1) continue; this.splice(pos,1); }