JavaScript Build Url Query String Params

Apr 16, 2020
const data = { url: 'https://twitter.com/jack/status/20', 'omit_script': 1 }const querystring = new URLSearchParams(data)// https://publish.twitter.com/oembed?url=https%3A%2F%2Ftwitter.com%2Fjack%2Fstatus%2F20&omit_script=1const oembedUrl = `https://publish.twitter.com/oembed?${querystring}`

NOTE: URLSearchParams Browser Support

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.