인프런 커뮤니티 질문&답변
숫자가 고정되어서 한가지숫자만 반복해서 나와요 ㅠ
작성
·
489
0
var 숫자1=Math.floor(Math.random()*9)+1
var 숫자2=Math.floor(Math.random()*9)+1
그냥 Math.floor(Math.random()*9)+1 는 랜덤으로 수가 나오는데
var 숫자1=Math.floor(Math.random()*9)+1
로 하면 한 숫자만 계속 고정해서 나옵니다.
왜 그런걸까요??ㅠㅠ





