"문자", '123',"abc","true"
123
true/false
null 의도적으로 비어둠
undefined 못찾는것
const obj = {key:"value", key:"value", "hello world":"hello"};
const arr = [1, 2, 3, 4, 5];
console.log(typeof 123213);
console.log(typeof "string");
값을 담을수 있는 그릇
변수 선언 규칙
var
재선언과 재할당이되서 잘 쓰지않는다 휴먼 오류가 있을수있음
let
let name;
console.log(name);
name = "steve";
console.log(name);
재선언은 되지않고 재할당은 된다
const
const number = 123;
console.log(number);
선언문의 소가로는 매개변수 파라미터
const hi = "hello";
const hellow = "123";
function gretting(input, second){
//본문 body
return "hello " + input + second;
}
//호출문의 소가로는 인자이다(함수호출문)
gretting(hi, hellow);
function grettingTwice(){
return gretting("hello","123") + "hello world";
}
console.log(grettingTwice());
// <,>,<=,>=,===,==,
1>2;
1 == "1";
1 ==="1";
//&&(and), ||(or), !(not)
1 && 1;
1 && 0;
//조건문
if(true){
}else{
//if문의 조건이 false 일 떼 else의 body가 실행
}