How do I use the js for loop condition to set up and exit?

var manySelectNote = [1,2,3,4,5,6]
for (i in manySelectNote){
  if (manySelectNote[i]>4) {
      console.log(1)
      break; 
  } else {
      console.log(2)
  }
}

Why do I use break , return , and sometimes execute console.log (2) ?

Mar.11,2021

is four 2s followed by a 1s and then exit the loop


according to you, loops should not be used here, but can be implemented in every

.
var manySelectNote = [1,2,3,4,5,6];
if(manySelectNote.every(value=>value<=4)){
    console.log(2);
}else{
    console.log(1);
}

will print four 2


this is not sometimes, is it four 2s and then one one?


http://www.runoob.com/js/js-s.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dbcb-2c3bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dbcb-2c3bf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?