![TypeScriptの型と値とバリデーション](https://cdn-ak-scissors.b.st-hatena.com/image/square/c63965ed7ac82c3ba93b91c72560d8ef1788551d/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--rGYgZ1nx--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3ATypeScript%2525E3%252581%2525AE%2525E5%25259E%25258B%2525E3%252581%2525A8%2525E5%252580%2525A4%2525E3%252581%2525A8%2525E3%252583%252590%2525E3%252583%2525AA%2525E3%252583%252587%2525E3%252583%2525BC%2525E3%252582%2525B7%2525E3%252583%2525A7%2525E3%252583%2525B3%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3Amizchi%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EtL0FPaDE0R2liclRHT052Z3d3ay1fNGxlcVk4TGNGSlNuX0FoWnpEWVlKaXJNcWc9czI1MC1j%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)
TypeScript is a typed superset of JavaScript with the potential to solve many of the headaches for which JavaScript is famous. But TypeScript has a learning curve of its own, and understanding how to use it effectively can take time. Effective TypeScript (2nd Edition) guides you through 83 specific ways to improve your use of TypeScript, following the format popularized by Effective C++ and Effect
TypeScriptの静的型付けの方針(?)で、静的に代入を許すことができてしまいます。 しかもここで紹介する、x.aを変更する方法では、asなどのunsafeな操作は必要としません。 結論 結論からお話します。 下記コードで、x.aが10に変更できます! const x: { readonly a: number } = { a: 42 } const y: { a: number } = x // x.aが変更されている y.a = 10 console.log(x) // { a: 10 } // コンパイルエラーはない { a: number } extends { readonly a: number }になっているから = { a: number }の変数に{ readonly a: number }の値を代入できるからです! 読み始める前に 本稿の主題は「静的型付き下でrea
今日は軽めの話題で。 先日 Prettier 2.8 をリリースしました。 We just released Prettier 2.8. This release includes support for TypeScript 4.9 satisfies operator and improvements to the --cache CLI option!https://t.co/Yfs7Pd5MsD — Prettier (@PrettierCode) November 23, 2022 TypeScript 4.9 で追加された satisfies 演算子 のサポートや --cache オプションの改善が含まれていて、人によっては嬉しいんじゃないかと思います。 この Prettier 2.8 ですが、実はリリースするつもりはありませんでした。 というのも、本当は Prettier 2
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く