We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Spread Syntax, Array into object literal
This is the behavior in every version I tried, and I reviewed the FAQ for entries about rest syntax.
Playground link with relevant code
const x = ["a", "b", "c"] console.log(x) const y = {...x} // expected {[x: number]: string} etc, but got {[x: number]: string, length: number, toString(): string .....} console.log(y.length) // undefined // expected undefined, but got number
y(spread array into object literal) 's property type is same as Array
y
y(spread array into object literal) 's property has only array value.
The text was updated successfully, but these errors were encountered:
Essentially a duplicate of #9726.
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
Spread Syntax, Array into object literal
π Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about rest syntax.
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
y
(spread array into object literal) 's property type is same as Arrayπ Expected behavior
y
(spread array into object literal) 's property has only array value.The text was updated successfully, but these errors were encountered: