DKDonghan Kiminstudio-pendant.hashnode.dev·Jan 7 · 5 min read의사난수생성기(prng)를 활용한 클라이언트 사이드 데이터 셔플모든 사용자에게 동일한 랜덤 순서를 보여줘야 하는데, DB나 서버에 의존하고 싶지 않다면? 문제 상황 팀의 신규 프로젝트를 맡아 작업 중인 와중에 이런 요구사항을 받았습니다. "캘린더에 표시되는 참여자 순서를 매일 다르게 섞어주세요. 단, 같은 날에는 모든 사용자가 동일한 순서를 봐야 해요." 아.. 아직 짬바가 부족한 저는 이 요구사항을 듣자마자 온갖 방법을 고민해보게 됐습니다. 저는 보통 일단 요구사항의 핵심을 단순화하여 로직으로 바꾼...00
DKDonghan Kiminstudio-pendant.hashnode.dev·Jan 4 · 1 min read[leetcode/JS] 2619. Array Prototype Last문제 https://leetcode.com/problems/array-prototype-last/description/ prototype object Array this 풀이 전체 코드 interface Array<T> { last(): T | -1; } Array.prototype.last = function() { if(this.length < 1) return -1 return this[this.length...00
DKDonghan Kiminstudio-pendant.hashnode.dev·Jan 4 · 1 min read[leetcode/JS] 2620. Counter 풀이문제 https://leetcode.com/problems/counter/description/ 일급객체로서의 함수 클로저 풀이 전체 코드 function createCounter(n: number): () => number { let current = n; const counter = (): number => { return current++; }; // 일급객체 counter 함수 리턴 ...00
DKDonghan Kiminstudio-pendant.hashnode.dev·Dec 15, 2025 · 2 min read[TIL/Vite] 모노레포 process.env 이슈 해결, Pollyfill 활용상황 정리 모노레포 프로젝트에서 어드민 앱(Vite, React.js)과 웹 앱(Next.js), React Native 모바일 앱 총 3가지 앱에서 공통으로 사용하는 types와 그 helper 들을 packages/database라는 공통 패키지로 관리하기 위해 리팩토링을 진행했습니다. 기존 코드는 ai를 적극 활용해서 만들어진 프로젝트라서, 속도감 있게 mvp 기능이 완성되었지만 QA를 진행하기 어려운 수준으로 구조가 망가져 있었거든요. ...00
DKDonghan Kiminstudio-pendant.hashnode.dev·Sep 14, 2025 · 1 min read[백준/js] 2178번 : 미로 탐색문제 https://www.acmicpc.net/problem/2178 풀이 0과 1로 이루어진 미로에서 한칸씩 이동하며 목표 거리까지 도달하는 데에 소요되는 최소 거리를 구하는 문제다. 최단 거리를 찾아야하기 때문에 bfs를 활용해서 풀이했다. // 2178 미로탐험 const [N, M, ...rows] = require("fs") .readFileSync("/dev/stdin") .toString() .trim() ...00