Even with the penetration of ES6 runtimes, converting js.html.NodeList to Array without using Array.from() is still something one needs to do. (IE11 is still very much at large, and Haxe’s Array doesn’t offer a from() method).
I was kinda hoping that Haxe’s js library would offer a cast for this, but I can’t imagine how, since a nodelist is not any kind of array. It’s just a collection with a length property.
I searched here and on the old google group for the preferred Haxe way to do this, but could find nothing.
Of course, I can make a loop, and copy the nodes over (casting each as Element as I push them in) but since vanilla js offers several one-line solutions to this fairly common problem, I hope I can be forgiven for expecting some Haxe sugar here.
This is not something which needs to be super-performant. I only do it at initialisation time. Main criteria for this solution are clarity, followed by brevity. Any suggestions?