## 事象 ```ts const query = {a: 1, b: null, c: undefined} new URLSearchParams(query).toString(); // a=1&b=null&c=undefined になってしまう ``` `a=1`になってほしい。 ## 原因 仕様? ## 解決方法 事前に除外してあげる。 ```ts const query = {a: 1, b: null, c: undefined} for (const qk of Object.keys(query)) { if (query[qk] == null) { delete query[qk]; } } new URLSearchParams(query).toString(); // a=1 ```