const str = 'Hello, World!';
// startIndex부터 endIndex 전까지의 문자열을 추출
const slicedStr = str.slice(0, 5);
console.log(slicedStr); // 'Hello'
const arr2 = [1, 2, 3, 4, 5];
// startIndex부터 deleteCount만큼의 요소를 제거하고, item1, item2, ...를 추가
arr2.splice(2, 2, 6, 7);
console.log(arr2); // [1, 2, 6, 7, 5]
const str2 = 'apple,orange,banana';
// separator를 기준으로 문자열을 나누어 배열로 반환
const fruits = str2.split(',');
console.log(fruits); // ['apple', 'orange', 'banana']
const str3 = 'Hello, World!';
// 문자열에서 searchValue를 찾아 replaceValue로 대체
const newStr = str3.replace('World', 'Universe');
console.log(newStr); // 'Hello, Universe!'