Create empty array using destructuring #3294
Labels
internal-issue-created
An internal Google issue has been created to track this GitHub issue
triage-done
Has been reviewed by someone on triage rotation.
Closure Compiler does not create empty iterable arrays using destructuring.
[...Array(3)]
Given the input:
A) We would expect the output to be:
'<select><option>0</option><option>1</option><option>2</option></select>'
https://jsfiddle.net/v9m7fzrd/
B) Instead, what we're getting is:
'<select></select>'
You can solve this issue in Closure Compiler using
Array(3).fill()
instead of [...Array(3)]Closure Compiler does not warn you or gives you an error. We noticed this while checking the user interface.
The text was updated successfully, but these errors were encountered: