Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript object to query params

const params = {
  name: 'John Doe',
  profession: 'Web Designer',
  age: 29
}

const qs = '?' + new URLSearchParams(params).toString()
console.log(qs)
// ?name=John+Doe&profession=Web+Designer&age=29
Source by attacomsian.com #
 
PREVIOUS NEXT
Tagged: #javascript #object #query #params
ADD COMMENT
Topic
Name
1+5 =