New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule proposal: avoid loops to create URLSearchParams
#2269
Comments
obj.entries()
to create URLSearchParams
Object.entries()
to create URLSearchParams
Do you even need the > new URLSearchParams(Object.entries({a: 1}))
URLSearchParams { 'a' => '1' }
> new URLSearchParams({a: 1})
URLSearchParams { 'a' => '1' } |
Judging by MDN, that's seems to be accepted. I think the problem used to be typescript, but that works now too https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams |
Object.entries()
to create URLSearchParams
URLSearchParams
Objects are not iterable |
Right, so |
Accepted. |
Description
It might be a bit niche, but not everyone knows that you can convert an object to a URLSearchParams without a for loop.
Fail
Pass
Additional Info
No response
The text was updated successfully, but these errors were encountered: