[자바스크립트/javascript] repeat() / fill() / flat()
repeat() MDN 정의 : 문자열을 주어진 횟수만큼 반복해 붙인 새로운 문자열을 반환합니다. "a".repeat(3) retult => "aaa" fill() MDN 정의 : 배열의 인덱스 범위 내에 있는 모든 요소를 정적 값으로 변경합니다. 그리고 수정된 배열을 반환합니다. MDN 예제 const array1 = [1, 2, 3, 4]; // Fill with 0 from position 2 until position 4 console.log(array1.fill(0, 2, 4)); // Expected output: Array [1, 2, 0, 0] // Fill with 5 from position 1 console.log(array1.fill(5, 1)); // Expected output:..