본문 바로가기

분류 전체보기79

Capitalize first letter ## Capitalize first letter **[How do I make the first letter of a string uppercase in JavaScript?](https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript)**[Ask Question](https://stackoverflow.com/questions/ask) - simple fastest ```jsx function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } consol.. 2023. 1. 9.
[Javascript] Promise.allSettled vs Promise.all, Promise states Pending Fulfilled Rejected Promise.all vs Promise.allSettled all // All values are non-promises, so the returned promise gets fulfilled const p = Promise.all([1, 2, 3]); // The only input promise is already fulfilled, // so the returned promise gets fulfilled const p2 = Promise.all([1, 2, 3, Promise.resolve(444)]); // One (and the only) input promise is rejected, // so the returned promis.. 2023. 1. 7.
[javascript] Promise vs setTimeout:: why Promise resolved first? Why Promise is resolved before setTimeout? - Event loop, task queue, micro task queue, stack Promise vs setTimeout Promise.resolve schedules a microtask and the setTimeout schedules a macrotask. And the microtasks are executed before running the next macrotask. console.log(1) setTimeout(() => { console.log(3) }); Promise.resolve().then(() => console.log(4)) console.log(7) Interesting question. I.. 2023. 1. 7.
[Quick Sort] Quick Select Quck sort, Quick Select Quick Sort function quickSortWidthEndPivot(arr, start, end) { if (start >= end) { return arr; } let left = start; let right = end - 1; let pivot = end; while (left arr[pivot] && high < arr[pivot]) { swap(arr, left, right); } if (low = arr[pivot]) right--; } swap(arr, left, pivot); pivot = left; // renew pivot position for next process quickSortWidthEndPivot(arr, start, pi.. 2023. 1. 7.
[Counting sort] 계수정렬 Counting sort const MAX_NUM = 10000; const MAX_SIZE = 10000; function countingSort(numbers) { let maxNum = -Infinity; for (const n of numbers) { if (n 2023. 1. 1.
[subset] find all subsets Number of Subsets of a given Set: If a set contains ‘n’ elements, then the number of subsets of the set is 2n. Number of Proper Subsets of the Set: If a set contains ‘n’ elements, then the number of proper subsets of the set is 2n - 1. | If A = {p, q} the proper subsets of A are [{ }, {p}, {q} with loop const nums = [1, 2, 3]; const subsets = [[]]; function findSubsets(subsets, nums, currentSet,.. 2022. 12. 25.
2. 이전 전략 그리고 어려움 3개월 안에 모든 걸 이전할 수 있을까? 이전 방식 결정 앱 전체 대시 보드만 이전 iframe: 독립된 대시보드 용 react app을 만들고 vue 내부에 react 앱 iframe으로 구현 component: react component를 만들고 이를 vue 내부에서 mount 시키기 React 이전 작업 필요 But frontend 팀은 Business 요구사항 동시 개발 QA에서 나오는 이슈 동시 처리 refactoring 기간은 짧은데 이 기간 동안 새로운 요구사항 진행, 기존 버그 fix 등 이전 작업 외 다른 일들을 동시에 진행해야 하는 어려운 환경 난이도 최상 2022. 12. 19.
1. React 이전 시작하게 된 이유 (수정 중) 기술 부채 + 최적화 현 상황 대시보드가 느리다. why? 기술 부채: Vue2, node 10 what? 무었 때문에 느리냐? Vue2 는 pub-sub 기반 상태 시스템 => destroy 시 모든 리스너들을 클리어 해야 한다 최신 기술 스택이 아니다 보니 virtual dom 등 최적화 부재 VueX 상태 관리 이전 시 장점 속도 향상: 최신 기술이 적용된 빠른 기술 시스템 긍정적인 개발 경험: 시장에서 필요하는 기술 역량 함양 구인이 수월해 진다 Why vue2 component destroy slow? In Vue 2, the process of destroying components in deeply nested structures might be slower due to several fac.. 2022. 12. 19.
가장 높은 우선순위: the highest precedence Precedence That is, the last override block in a config file always has the highest precedence. 시간 따위에서 앞서기 순서 따위에서 앞서기 2022. 12. 19.
Join 3 tables > group by > COUNT > How to show 0? count the number of SELLING CAR_ID 1000 sold at each BRANCH: if a BRANCH did not sell any 1000 CAR_ID, PRINT 0 SELCT: employee join branch left join sellings I want to count the number of cars sold at each branch where CAR_ID is 1000 If there is no car sold at a branch, I need to print out 0. select s.id as SELLING_ID, s.car_id as CAR_ID, e.id as EMPLOYEE_ID, -- COUNT(s.id), b.id as BRANCH_ID, b.. 2022. 11. 26.