6월25일 금요일 TIL

김병훈·2021년 6월 25일
0

til

목록 보기
23/89

typeof 연산자

typeof 연산자는 피연산자의 평가 전 자료형을 나타내는 문자열을 반환합니다.

console.log(typeof 42);
// expected output: "number"
console.log(typeof 'blubber');
// expected output: "string"
console.log(typeof true);
// expected output: "boolean"
console.log(typeof undeclaredVariable);
// expected output: "undefined"

Array.prototype.splice()

splice() 메소드는 배열의 기존 요소를 삭제 또는 교체하거나 새 요소를 추가하여 배열의 내용을 변경한다.

Array.prototype.join()

join() 메서드는 배열의 모든 요소를 연결해 하나의 문자열로 만든다.

const elements = ['Fire', 'Air', 'Water'];
console.log(elements.join());
// expected output: "Fire,Air,Water"
console.log(elements.join(''));
// expected output: "FireAirWater"
console.log(elements.join('-'));
// expected output: "Fire-Air-Water"

git restore

git reset

profile
블록체인 개발자의 꿈을 위하여

0개의 댓글