일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- extends
- interface
- map
- Filter
- supabase auth
- array
- Spring
- meatadata
- 페이지네이션
- TS
- supabase 페이지네이션
- reactnative
- generic
- async
- code-push-standalone
- codepush
- 이진탐색
- 글또10기x코드트리
- 코드푸시
- app.post
- supabase authentication
- set
- 타입스크립트
- Next.js
- javascript
- 스크롤이벤트
- 슬라이딩윈도우
- xlsx-js-style
- react
- 상속
- Today
- Total
목록전체 글 (170)
rhanziy
array.forEach는 받아온 array를 for 반복문 없이 item(element) 하나씩 function에 넣을 수 있는 함수 arr.forEach(callback(currentvalue[, index[, array]])[, thisArg]) 다음 세 가지 매개변수를 받는다. element - 처리할 현재 요소. index(Optional) - 처리할 현재 요소의 인덱스. array(Optional) - filter를 호출한 배열. const arr = ["pizza", "hamburger", "chicken"]; arr.forEach((food)=> console.log(food)); 배열안의 element 하나하나를 food라는 이름으로 정의하고 콘솔을 찍은 결과값 pizza hamburge..
object -> string 으로 변환하는 방법은 JSON.stringify( object name ) 을 해주면 된다. js에서 localStorage.setItem()을 할 때, localStorage는 js의 오브젝트를 저장할 수 없다. object -> string 바꿔 localstorage에 저장해야한다. localStorage.setItem(localStorage KEY, JSON.stringify(오브젝트[])); string -> object 로 변환하는 방법은 JSON.parse( localStorage key ) 를 해주면 된다. const savedToDos = localStorage.getItem(localStroage KEY); if(savedToDos){ const parse..
setInterval(sayHello, 5000); sayHello( )를 5초마다 실행 setTimeout(sayHello, 5000); sayHello( )를 5초 후에 실행. 1회성 padStart( ); (targetLength, padString) 현재 문자열의 시작을 다른 문자열로 채워, 주어진 길이를 만족하는 새로운 문자열을 반환. 채워넣기는 대상 문자열의 시작(좌측)부터 적용 >> string타입. 데이터 타입변환 필요하다. ex) String(date.getSeconds()).padStart(2, "0"); date객체의 초를 받아와서 10초 이하, 즉 1, 2, 3초일 경우 앞에 0을 채워넣는다. padEnd( ); 는대상 문자열의 시작(좌측)부터 적용 appendChild( )는 구조..
class Counter { constructor(runEveryFive){ this.counter = 0; this.callback = runEveryFive; } increase(){ this.counter++; console.log(this.counter); if(this.counter % 5 === 0){ this.callback && this.callback(this.counter); // this.callback이 있다면 함수를 실행 } } } function printSomething(num){ console.log(`yo! ${num}`); } function alertSomething(num){ alert(`yo! ${num}`); } const coolCounter = new Count..

Warning: Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state. "현존하는 state의 변화중에는 업데이트 할수 없습니다 "('랜더'내에서와 같이) 랜더 methods는 props와 state를 가진 하나의 순수한 function 이어야 합니다." Render 메서드 내부에 setState로 state를 변경하지 말라는 경고메세지이다. Render 내부에서 state를 바꾸면 모든 컴포넌트가 다시 렌더링되므로 무한 루프가 발생한다. 생활코딩 리액트 강의를 듣고 간단한 CRUD를 복습하면서 마주하게된 경고메세지..
async 키워드를 사용하면 반환받는 값은 Promise가 된다. fulfil Promise가 반환되기 때문에 반환된 값을 사용하기 위해선 .then() 블럭을 사용해야 한다. Async/await 는 우리의 코드를 마치 동기식 코드처럼 보이게 한다. 그리고 어떤 면에서는 정말로 동기적으로 행동합니다. 함수 블럭에 여러 개의 await 키워드를 사용하면 Promise가 fulfilled되기 전 까지 다음 await 을 차단해버린다!! >> Promise.all API 사용! 전달인자로 Promise를 받는데, [배열]로 받는다 // async & await // clear style of using promise // 1.async // function fetchUser(){ // return new P..
Promise는 세 개중 하나의 상태를 갖는다. pending(대기): Promise가 생성되어 작업을 진행 중인 상태 fulfilled(이행): Promise가 작업을 성공적으로 완료한 상태 rejected(거절됨): Promise가 작업을 완료하였지만 실패한 상태 완료 상태인 fulfilled와 rejected를 합쳐 settled라고도 한다고 함. 이러한 상태 정보는 [[PromiseState]]에 명시된다. // 비동기를 간편하게 처리할 수 있도록 도와주는 object // promise is a JavaScript object for asynchronous operation. // state: pending -> fulfilled or rejected // Producer vs Consumer ..
'use strict'; { // 배열 값을 join하여 출력, join(seperator)는 optional // 배열의 모든 요소를 연결해 하나의 문자열로 만든다. const fruits = ['apple','banana','orange']; const result = fruits.join(' and '); console.log(result); } { // make an array out of a string 문자열을 배열로 변환 // seperator 필수! 어떤걸 기준으로 쪼갤지 // limit은 optional > 출력 개수 const fruits = '🍕,🍔,🍟,🌭'; const result = fruits.split(','); console.log(result); } { // make thi..