카테고리 없음
생활코딩-언어-JavaScript
SOME코딩
2022. 3. 17. 18:34
<22.3.17>
<언어소개>
웹브라우저에서 사용
웹서버를 조작하기 위해서도 사용된다. node.js
웹서버 사용 언어: php, java,python
탈웹 사례: google apps script(google spread sheet)
<실행과 실습(1/3): 코드작성과 실행>
웹브라우저를 실습환경으로 사용(크롬)
text에디터: 메모장
ctrl+o로 파일열기
<실행과 실습(2/3): 콘솔 사용법>
f12개발자도구
console.log('Hello world');
<실행과 실습(3/3): 도구의 선택>
sublime text
<숫자와 문자(1/4): 수의 표현>
alert(1);
alert(1.1);
alert(1+1);
alert(1.1+1.1);
alert(2*8);
alert(6/2);
<22.3.18>
<숫자와 문자(2/4): 수의 연산>
Math.pow(3, 2); 제곱
Math.round(10.6); 반올림 11
Math.ceil(10.2); 올림 11
Math.floor(10.2); 내림 10
Math.sqrt(9) 제곱근 3
Math.random(); 랜덤한 수(0부터 1.0 사이의 랜덤한 숫자)
Math.round(100 * Math.random());
<숫자와 문자(3/4): 문자의 표현>