Math.pow(3,2); // 9, 3의 2승 Math.round(10.6); // 11, 10.6을 반올림Math.ceil(10.2); // 11, 10.2를 올림Math.floor(10.6); // 10, 10.6을 내림Math.sqrt(9); // 3, 3의 제곱근Math.random(); // 0부터 1.0 사이의 랜덤한 숫자
alert(typeof "1") 결과 : stringalert(typeof 1) 결과 : number
-문자열 안에 따옴표 넣기
alert('egoing\'s javascript')
-줄 바꿈alert("안녕하세요.\n생활코딩의 세계에 오신 것을 환영합니다");
-문자 붙이기alert("coding"+" everybody");
댓글 없음:
댓글 쓰기