함수 (선언식)
function 함수이름(input1, input2){
return output
}
함수 (표현식)
let add = fuction(input1, input2){
}
화살표함수
let add = (input1, input2) => {
return문
}
let add = (input1, input2) => (
input1 + input2
)
객체 선언
const 객체이름 = {
key1 : value1,
key2 : value2,
}
key1, key2 : 부를 이름
value1, value2 : 값
객체 접근
객체이름.key1
객체이름['key1']
객체 추가
객체이름.key3 = value3
객체 삭제
delete 객체이름.key3
메소드
const person = {
name : "seoyeon",
age : 24,
hasCompany : false,
isStudent : function(){
console.log("학생 입니다.")
}
}
person.isStudent()
let arr = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ];
