인증번호 코드

taengg·2021년 11월 1일
0
post-thumbnail

1.핸드폰 인증번호 코드
6자리 숫자를 무작위로 생성
const token = String(Math.floor(Math.random() * 1000000)).padStart(6,"0")

  1. 토큰을 만들어서 기능으로 저장
    function getToken() {
    const token = String(Math.floor(Math.random() * 1000000)).padStart(6,"0")
    console.log(token)
    }
  2. getToken()호출 시 랜덤번호 생성!
profile
고양이 키우는 감자개발자

0개의 댓글