LoginSignup
0
2

【JavaScript】オブジェクトからクエリパラメータを生成する方法

Last updated at Posted at 2023-12-23

以下のように記述することでオブジェクトからクエリパラメータを生成することができます。

const params = new URLSearchParams({ sample: 10, example: 20 })
console.log(params.toString()) // "sample=10&example=20"
0
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2