배열의 맴버를 하나씩 꺼내서 어떤 일과작업을 처리할때 사용
ex_
let arr2 = [10, 20, 30, 40, 50];
let results2 = arr2.map( data => data * 3 );
배열의 멤버를 하나씩 꺼내서 조건에 맞는 맴버를 추릴때
let arr4 = [10, 20, 30, 40, 51];
let results5 = arr4.filter( data => data % 2 );
배열의 맴버를 하나씩 꺼내서 누적합, 누적곱, 등등 일괄연산을 처리할때
let arr4 = [10, 20, 30, 40, 51];
// pv는 이전값 cv는 현재값
console.log( arr4.reduce( ( pv, cv ) => pv + cv ) );
키:값을 여러개 가진 컬렉션 타입
이 세상에 존재하는 모든 유형|무형의 존재인 엔티티를 프로그램 세상에 표현하기 위해서 사용
let w = "weight"
const obj1 = {
name:"JS",
age:33,
height,
[w]:60,
arr:[1,2,3,4],
spec:{},
getAge:function () {
return `${ this.name }의 나이는 ${ this.age } 입니다.`;
}
print(){
console.log("출력");
}
}