| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
- react
 - ES6+
 - array
 - dev
 - API
 - 햇소
 - DOM
 - hooks
 - ChatGPT
 - html5
 - github
 - 함수
 - 최적화
 - object
 - 변수
 - 선택자
 - hatso
 - AI
 - learn next.js
 - gitCLI
 - es6
 - next.js
 - git
 - JS
 - CSS
 - 우아한테코톡
 - Python
 - This
 - JavaScript
 - ES5+
 
- Today
 
- Total
 
목록array (4)
codinghatso
자바스크립트의 Array는 객체(함수)이기 때문에 new Array()로 특정 길이의 배열을 생성할 수 있지만 초기값이 undefined로 설정되는 문제가 있다. 하드코딩을 통한 초기값 지정 방법이 있지만 좋은 방법은 아닌 듯합니다. https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/from Array.from() - JavaScript | MDN Array.from() 메서드는 유사 배열 객체(array-like object)나 반복 가능한 객체(iterable object)를 얕게 복사해 새로운Array 객체를 만듭니다. developer.mozilla.org Array.from() 메서드는 유사 배열..
참고 : Link - ( https://ko.javascript.info/destructuring-assignment ) 객체와 배열은 자바스크립트에서 가장 많이 쓰이는 자료 구조입니다. 키를 가진 데이터 여러 개를 하나의 엔티티에 저장할 땐 객체를, 컬렉션에 데이터를 순서대로 저장할 땐 배열을 사용하죠. 개발을 하다 보면 함수에 객체나 배열을 전달해야 하는 경우가 생기곤 합니다. 가끔은 객체나 배열에 저장된 데이터 전체가 아닌 일부만 필요한 경우가 생기기도 하죠. 이럴 때 객체나 배열을 변수로 '분해’할 수 있게 해주는 특별한 문법인 구조 분해 할당(destructuring assignment)을 사용할 수 있습니다. 이 외에도 함수의 매개변수가 많거나 매개변수 기본값이 필요한 경우 등에서 구조 분해(..
indexOf() 검색 /** * Returns the index of the first occurrence of a value in an array, or -1 if it is not present. * @param searchElement The value to locate in the array. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. */ indexOf(searchElement: T, fromIndex?: number): number; indexOf: * 배열에서 값이 처음 나타나는 인덱스를 반환하거나 값이 없으면 -1을 반..
*API 관련 업로드는 lib.es5.d.ts 파일의 내용을 바탕으로 공부했습니다. *파일에는 IDE(VScode)기능으로 mac은 command키 window는 control키를 누르고 원하는 함수를 클릭하면 파일이 열립니다. toString(), toLcaleString() 문자열 /** * Returns a string representation of an array. */ toString(): string; /** * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods. */ toLocaleString(): string; toString():..