forEach
大概是沒有辦法中斷了,我們可以采用其它的辦法來實(shí)現(xiàn)循環(huán)
Array.prototype.some
當(dāng)return true
的時(shí)候,會(huì)終止遍歷
Array.prototype.every
當(dāng)return false
的時(shí)候,會(huì)終止遍歷
forEach
大概是沒有辦法中斷了,我們可以采用其它的辦法來實(shí)現(xiàn)循環(huán)
當(dāng)return true
的時(shí)候,會(huì)終止遍歷
當(dāng)return false
的時(shí)候,會(huì)終止遍歷