TIL 33. 랜덤함수

주민콩·2021년 2월 24일
0

배열이 수도없이 많은데 조건이 랜덤을 돌리면서 3개를 노출을 시켜야한다!

랜덤함수

let arr = data;
  arr.sort(function () {
    return Math.random() - Math.random();
  });

  console.log(arr);
profile
코딩하면서 기록하는 메모장 ᰔ

0개의 댓글