자주까먹는거 메모
개체의 모든 속성에 null 값이 있음을 확인할 때
const test = { 춘식: null, 라이언: null, 어피치: null};
const allPropertiesAreNull = Object.values(test).every(value => value === null);
if (allPropertiesAreNull) {
console.log("All properties of the object have a value of null");
} else {
console.log("Not all properties of the object have a value of null");
}
정의와 동시에 실행하는 함수
보편적으로 전역스코프 오염을 방지하기 위해 사용,
실제로 JSX내에서 if문쓸때 주로 사용
(()=>{})()
예시
{list &&(()=>{
console.log('야호')})();}
Array.from('foo')); // -> [‘f’, ‘o’, ‘o’]
Array.from({length: 5}, (v, i) => i); // [0, 1, 2, 3, 4]
Array.from({length: 7}, (v, i) => i-3); // [-3, -2, -1, 0, 1, 2, 3]