: 주어진 판별 함수를 만족하는 첫 번째 요소의 값을 반환합니다. 그런 요소가 없다면 undefined를 반환합니다.
/**
* Removes the last element from an array and returns it.
* If the array is empty, undefined is returned and the array is not modified.
*/
pop(): T | undefined;
: pop() 메서드는 배열에서 마지막 요소를 제거하고 그 요소를 반환합니다.
/**
* Appends new elements to the end of an array, and returns the new length of the array.
* @paramitems New elements to add to the array.
*/
push(...items: T[]): number;
:push() 메서드는 배열의 끝에 하나 이상의 요소를 추가하고, 배열의 새로운 길이를 반환
/**
* Combines two or more arrays.
* This method returns a new array without modifying any existing arrays.
* @paramitems Additional arrays and/or items to add to the end of the array.
*/
concat(...items: ConcatArray<T>[]): T[];
: 인자로 주어진 배열이나 값들을 기존 배열에 합쳐서 새 배열을 반환합니다.
/**
* Adds all the elements of an array into a string, separated by the specified separator string.
* @paramseparator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
*/
join(separator?: string): string;
: 배열의 모든 요소를 연결해 하나의 문자열로 만듭니다.
: ()에 삽입한 문자로 하나의 문자열로 결합한다.
/**
* Reverses the elements in an array in place.
* This method mutates the array and returns a reference to the same array.
*/
reverse(): T[];
: 배열의 순서를 반전합니다. 첫 번째 요소는 마지막 요소가 되며 마지막 요소는 첫 번째 요소가 됩니다.
: 원래(original)의 배열 데이터 순서를 바꿔 놓기 때문에 주의 해야 한다!
/**
* Removes the first element from an array and returns it.
* If the array is empty, undefined is returned and the array is not modified.
*/
shift(): T | undefined;
:배열에서 첫 번째 요소를 제거하고, 제거된 요소를 반환합니다. 이 메서드는 배열의 길이를 변하게 합니다.
/**
* Returns a copy of a section of an array.
* For both start and end, a negative index can be used to indicate an offset from the end of the array.
* For example, -2 refers to the second to last element of the array.
* @paramstart The beginning index of the specified portion of the array.
* If start is undefined, then the slice begins at index 0.
* @paramend The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.
* If end is undefined, then the slice extends to the end of the array.
*/
slice(start?: number, end?: number): T[];
:어떤 배열의 begin부터 end까지(end 미포함)에 대한 얕은 복사본을 새로운 배열 객체로 반환합니다.
원본 배열은 바뀌지 않습니다.
/**
* Sorts an array in place.
* This method mutates the array and returns a reference to the same array.
* @paramcompareFn Function used to determine the order of the elements. It is expected to return
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
* value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
* ```ts
* [11,2,22,1].sort((a, b) => a - b)
* ```
*/
sort(compareFn?: (a: T, b: T) =>number): this;
:배열의 요소를 적절한 위치에 정렬한 후 그 배열을 반환합니다.
기본 정렬 순서는 문자열의 유니코드 코드 포인트를 따릅니다.
/**
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @paramstart The zero-based location in the array from which to start removing elements.
* @paramdeleteCount The number of elements to remove.
* @returns An array containing the elements that were deleted.
*/
splice(start: number, deleteCount?: number): T[];
: 배열의 기존 요소를 삭제 또는 교체하거나 새 요소를 추가하여 배열의 내용을 변경합니다.
: Return은 삭제된 요소가 출력됩니다.
/**
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
* @paramstart The zero-based location in the array from which to start removing elements.
* @paramdeleteCount The number of elements to remove.
* @paramitems Elements to insert into the array in place of the deleted elements.
* @returns An array containing the elements that were deleted.
:배열 내의 모든 요소 각각에 대하여 주어진 함수를 호출한 결과를 모아 새로운 배열을 반환합니다.
/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @parampredicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
* @paramthisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @paramcallbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
* @paraminitialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
: 배열의 각 요소에 대해 주어진 리듀서(reducer) 함수를 실행하고, 하나의 결과값을 반환합니다.
: 'return'값이 다음 호출의 'Prev'값이 된다. ※값을 누적할 때 사용!
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @paramcallbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @paraminitialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.