Hard
TypeScriptでarray.includes()を使った型の絞り込みが効かない
Taro · 7/5/2026 · 35 views
const arr = ['a', 'b'] as const; と定義した配列に対してarr.includes(value)でtrueだったのに、その後value の型がまだ絞り込まれず string のままです。なぜでしょうか。
Taro · 7/5/2026 · 35 views
const arr = ['a', 'b'] as const; と定義した配列に対してarr.includes(value)でtrueだったのに、その後value の型がまだ絞り込まれず string のままです。なぜでしょうか。
Hard / Looking for a solution
Neither AI nor experts could solve this. Please help with your knowledge and experience.