For example if I have the code:
let c = new URL("http:/google.com");
c.search = "d d=m";
console.log(c.href)
It produces "http://google.com/?d%20d=m"
However, if I do:
let c = new URL("http:/google.com");
c.searchParams.set("d d", "m");
console.log(c.href)
This results in "http://google.com/?d+d=m"
.
Why do these methods produce two different results?