Advertisement
Gourmet_codes

Test

Sep 19th, 2020
1,327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const star = {
  2.     x: window.innerWidth,
  3.     y: window.innerHeight
  4. };
  5.  
  6. const random = (min, max) => {
  7.    return Math.floor(Math.random() * (max - min)) + min;
  8. };
  9.  
  10. cost makeStar = star => {
  11.     const newStar = { ...star };
  12.     newStar.x = random(0, star.x);
  13.     newStar.y = random(0, star.y)
  14.     return newStar;
  15. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement