[Vuejs]-Get random IDs for ranking

0๐Ÿ‘

โœ…

I think the better way to do that is to make parent function where you can generate all two random numbers. Then you can simply save them in localstorage. After this you should invoke your functions with a parameter. Something like this

function genAndSaveAndShow() {
  let rnd1 = genRandom(1,10),
      rnd2 = genRandom(1,10);
  saveInfoToStorage({userId: 1, numbers: [rnd1, rnd2]});
  addImage(rnd1);
  addImage(rnd2);
}

Leave a comment