URLSearchParams is an iterable. If you log it with your example you should see something like URLSearchParams {size: 2}
in the console.
To get a plain object you can do Object.fromEntries(params)
to get an object with the values (or empty if there are no params).