2024年10月– date –
-
メモ [leetCode] 119. Pascal’s Triangle II
※こちらの記事は Pascal's Triangle IIをした際にAIに聞いてみた学習メモです [leetCode] 119. Pascal's Triangle II solutionで見たこのコード var getRow = function(r) { let ans = new Array(r + 1) ans[0] = ans[r] = 1; for(let i = 1, up = r;... -
[TypeScript] Recordや{[key]: string}よりnew Mapを使う理由
Recordや{[key]: string}よりnew Mapを使う理由 const obj: Record = { a: 'a' }; // itemはstringとして推論される、実態はundefined const item = obj.b; // Cannot read properties of undefined (reading 'toUpperCase') item.toUpperCase(); const ho... -
[React] React v19のsandbox|example
[React] React v19のsandbox|example https://stackblitz.com/edit/vitejs-vite-n7qcji?file=src%2FApp.tsx 理解を助けてくれた記事 https://react.dev/reference/react https://run-on.dev/ja/learn/react19 https://zenn.dev/uhyo/books/react-19-new ht... -
[TypeScript] Prittifyでネストされた型を綺麗に見せる by matt
[TypeScript] Prittifyでネストされた型を綺麗に見せる by matt playground Person & {isDeveloper: boolean}を hoverすると だけれど、Prittifyを通すと このように全てが展開されるというもの type Prittify<T> = {[K in keyof T]: T[K]} &... -
[TypeScript] satisfiesの使い所、威力を発揮する時
[TypeScript] satisfiesの使い所、威力を発揮する時 mattさんの動画から playground Example 1 const score: Record<string, number> = {} // 広い型である必要がある score.english = 100 score.math = 40 // Record<string, number>は変数自...
1