Is there an easy way to add an array of raycasthit2Ds to a list? (javascript)

I have been using this:

var hits : RaycastHit2D[] = Physics2D.LinecastAll (value, value);

But I’m slowly learning that the built in arrays in javascript suck and I’d like to be able to use some of the functions that a list has instead. Is there a nice (not memory intensive) way to convert the array of RaycastHit2Ds to a list?

I wanted to use the join function, but that doesn’t seem to be a function of the built in arrays.

Thankyou!

Romano

var hitsList = new List.(Physics2D.LinecastAll (value, value));

Best I’ve got so far:

    var hitsList : List.<RaycastHit2D> = new List.<RaycastHit2D>();
    
    for (var a = 0; a < hits.length; a++)
    {
    	hitsList.Add(hits[a]);
    }