SHARE
TWEET

oddArray

a guest Mar 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function oddArray(array) {
  2.   var newArray = [];
  3.  
  4.   for (var i = 0; i < array.length; i++) {
  5.     if ((array[i] % 2) > 0) {
  6.       newArray.push(array[i]);
  7.     }
  8.   }
  9.  
  10.   return newArray;
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top