본문 바로가기
카테고리 없음

자바스크립트 숫자와 문자

by Son 2022. 1. 12.

Math.pow(3.2); //제곱근 9

Math.round(10.6); // 반올림 11

Math.ceil(10.2); //올림 11

Math.floor(10.2); //내림 10

Math.sqrt(9); //제곱근 3

Math.random(); //0~1사이의 난수

100*Math.random(); //난수 0~100 사이

alert('egoing\'s coding everybody');  //출력형태 egoing's coding everybody 즉 '를 출력하기 위한 \(역슬래쉬)