자바 스크립트

자료형

Number , Boolean , String , Symbol , BigInt , null , undefined <br>

Backtick

console.log(`${1+2}`) //3

객체

const student = {id : 1001 , name : "홍길동"};

console.log(student.id , student.name) //1001 홍길동
student.id = 2000; // .연산자를 이용하여 객체의 요소를 접근 할 수 있다
student["name"] = "Hong gil dong" //""안에 있는 값이 객체의 키가 된다 그 키안의 값을 초기화 할 수 있다
student.grade = 4.07; //새로운 요소를 출력 할 수 있다
console.log(student); // id : 2000 , name:"Hong gil dong" , grade : 4.07}
student.speak = function() { console.log("안녕하세요")}; //함수를 property로 등록 할 수도 있다
delete student.grade; //"grade" property를 삭제
console.log("id" in student , "grade" in student) //true false

단, 숫자와 문자열사이 연산자가 들어가 있으면 문자열이 숫자로 변환이 된다<br>

var을쓰지 않고 let을 쓰는 이유는 hoisting 방지를 위해서 이다 var을 쓰면은 유지보수가 어려움 또 , let과 const는 Block Scope이다 <br>

for / of