Virajsinh

each loop JQuery

May 23rd, 2020
487
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //https://www.sitepoint.com/jquery-each-function-examples/
  2.  
  3. // ARRAYS
  4. const arr = [
  5.   'one',
  6.   'two',
  7.   'three',
  8.   'four',
  9.   'five'
  10. ];
  11.  
  12. $.each(arr, function(index, value) {
  13.   console.log(value);
  14.   // Will stop running after "three"
  15.   return (value !== 'three');
  16. });
RAW Paste Data