HTML은 정보다
CSS는 디자인이다
JAVA는 사용자와 상호작용한다
자바스크립트 실행법
웹페이지에서 F12를 누르면 개발자 도구 등장!
콘솔 부분에서 코드를 입력해보자.
이는 대화형실행환경(인터렉티브모델)이라 한다.
Visual Studio Code
console.log() 콘솔을 열었을 때만 보이는 것으로 버그를 찾을 때 주로 사용
document.write() 웹에서 볼 수 있음
(1+1)=2
('1'+'1')=11
('hello'+'world')=hello world
alert() 경고창
confirm() 확인/취소 가능한 창
Math.random() 숫자가 랜덤 출력
Math.floor() 숫자 내림
input type="button" value="Hello"
Hello라고 적힌 버튼을 추가, 클릭시 안녕이라는 경고창이 뜸
//뒤의 문자는 주석으로 컴퓨터가 출력하지 않음
-operator
console.log(1+1);
console.log(2-1);
console.log(2*2);
console.log(4/2);
-함수
console.log(Math.random);
console.log(Math.floor(Math.random()*100));
console.log(Math.floor(1.9));
문자열은 string
변수 : 데이터에 이름을 붙인 것
var 혹은 let
var a = 1;
'=은 대입연산자 a는 변수 1은 상수(constant/바뀌지않는값)'
console.log(a);
let b = 1;
console.log(b);
변수의효용
let 가격 = 1000;
let 부가가치세율 = 0.1;
let 부가가치세 = 가격*부가가치세율;
console.log(부가가치세);
어려웠던 점 / 해결방법 / 학습소감
아직 기초내용이고 강사님께서 설명을 잘해주셔서 크게 어려웠던 점은 없었다. 충분한 복습을 통해 코드가 손에 익을 수 있도록 해야겠다.