Spread operator should work with HTML collections
Current
Input:
const elements = [ ...document.querySelectorAll('div') ];
Output:
var elements = [].concat( document.querySelectorAll('div') );
The problem is that this creates an array with a single item (the HTML collection), instead of an array of HTML elements.
Proposed
Perhaps Bublé could first check if the object is a native array, and if not, output something like this:
var elements = Array.prototype.slice.call( document.querySelectorAll('div') );
This would correctly coerce the HTML collection into an array.