Skip to content

Instantly share code, notes, and snippets.

@rafegoldberg
Last active January 28, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafegoldberg/594f93be479c192e4a26b8fc3ce3a837 to your computer and use it in GitHub Desktop.
Save rafegoldberg/594f93be479c192e4a26b8fc3ce3a837 to your computer and use it in GitHub Desktop.
New Array Filled Randomly (Javascript)
let
set = [...Array(40)].map(e=> ~~(Math.random()*40))
@rafegoldberg
Copy link
Author

rafegoldberg commented Jan 26, 2019

apparently the ~~ operator is short for Math.floor, who knew? More here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment