javaScript 2일차

정준호·2022년 3월 3일
0

JavaScript

목록 보기
2/7
post-thumbnail

출력문(print)
document.write();
console.log();
alert();

입력창(Scanner)
prompt(); - 문자형으로 받아드림 (String)
confirm(); - 확인,취소(boolean)

형변환
숫자(정수) : parseInt()
숫자(실수) : parseFloat()
숫자형 : Number()
숫자 -> 문자 : toString()

조건문(.equals())
if(color=='빨강')

변수선언시 초기값 설정
let total = 0;
let str = "";
let check = true;

ex10반복문예제


ex11반복문실습 - Math.random() = 0~1사이숫자

Math.random()100 - 0단위가 2개올라감
Math.floor(Math.random()
100) - 0단위 2개올라간후 소수점은없앤다.

ex12실행위치

Array
ex01배열

ex02배열실습

ex03배열실습

ex04배열함수

profile
파이팅

0개의 댓글