Closed
Description
Bug Report
🔎 Search Terms
Spread, Spreading, Array, Object, Destruct, Destructuring
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about Spreading an array to an Object.
⏯ Playground Link
💻 Code
const a = [1, 2, 3];
const b = { ...a };
b.pop();
🙁 Actual behavior
TS did not show that .pop()
did not exist in the new variable. The new variable type has "all the properties" from the array, including the prototype functions. I guess that's why it failed to show that the function doesn't exist.
Example of the code failing:
🙂 Expected behavior
It should show values from the Object prototype and not from Array.
Metadata
Metadata
Assignees
Labels
No labels