//url.searchParams is a type of "URLSearchParams"
//we can construct an array:
a = Array.from(url.searchParams)
//we can iterate
url.searchParams.forEach((value, name) => console.log(name, value));
//get a value
url.searchParams.get('width')
//a is an array, and eacy element is a pair (two elem array), a key-value (or assoc)
//accumulator function
fct = (dictAccumulator, eachPair) => {dictAccumulator[eachPair[0]] = eachPair[1]; return dictAccumulator;}
//reduce into map
dict = a.reduce(fct, {});
//now
dict.width
//1000
dict['height']
//200