Using the array method some, this loop will be jumped out of when return is true.
let arr = [1, 2, 'lemon', 4, 5,'666']
arr.some((item) => {
if (item === 'lemon') {
return true
}
})
Using the array method some, this loop will be jumped out of when return is true.
let arr = [1, 2, 'lemon', 4, 5,'666']
arr.some((item) => {
if (item === 'lemon') {
return true
}
})