SHARE
TWEET

Untitled

a guest Nov 19th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var myArray = [];
  2. appendItem(myArray, randomNumber(1,10));
  3. appendItem(myArray, randomNumber(1,10));
  4. appendItem(myArray, randomNumber(1,10));
  5. appendItem(myArray, randomNumber(1,10));
  6. appendItem(myArray, randomNumber(1,10));
  7. appendItem(myArray, randomNumber(1,10));
  8. appendItem(myArray, randomNumber(1,10));
  9. appendItem(myArray, randomNumber(1,10));
  10. appendItem(myArray, randomNumber(1,10));
  11. appendItem(myArray, randomNumber(1,10));
  12.  
  13. console.log("Before: " + myArray);
  14.  
  15. for (var i = 0; i < myArray.length; i++) {
  16.  
  17.   myArray[i] = 10;
  18.  
  19. }
  20.  
  21. console.log("After: " + myArray);
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