I recently got this error message from a popup/toast message: “TypeError: [variable name] not iterable”. My guess was a variable was assumed to be array but it’s undefined. And that’s the issue.
In the example below, since prop is undefined, using the spread operator ... here will fail because this expects an array.
prop = undefined
value = [...prop]
VM174:1 Uncaught TypeError: prop is not iterable
at <anonymous>:1:13
To handle that scenario, use nullish coalescing operator (??):
values = [...(prop ?? [])];