typeof operand
typeof(operand)
let str = 'abcdefg';
console.log(str.slice(0,3)); // abc : 3번째 인덱스는 포함하지 않으므로 abc
// 0번째 자리부터 3글자 이런식으로 하면 쉬움
let cars = ['sonata', 'tico', 'spark', 'genesis']
cars.splice(1,1) // 1번째 인덱스에서 한개 요소 제거 : tico제거
//.splice(1, 2, 3); 형태이다. **1: 인덱스 2: 제거할 개수 3: 추가할 요소**
let words = ['have', 'a', 'nice', 'day'];
words.join() // 'have,a,nice,day'
words.join('') // 'haveaniceday'
words.join('-') // 'have-a-nice-day'
<aside> 💡 .substring() : start와 end를 바꿔서 처리한다. 즉, .substring(1, 0)의 경우 .substring(0, 1)로 처리한다.
.slice() : 그냥 비어있는 문자열을 리턴한다. 즉, ''를 리턴한다.
</aside>
<aside> 💡 .substring() : start값이 음수인 경우 start는 0이다. 마찬가지로 end값이 음수인 경우 end는 0이다.
.slice() : string의 가장 뒤에서 음수의 절대값만큼 내려온 index로 취급한다.
</aside>
// 두개는 같은 의미를 갖는다.
for(let arr[i] of arr)
for(let i=0; i<arr.length; i++)