Help on translating this c# to Javascript

Could someone help me translating this to Unity javascript? I couldn't find any reference on how to use List function in java.

private GameObject[] AvailableSpawnPoints() : GameObject[] //checks for available spawnpoints
{
    List<GameObject> gos = new List<GameObject>();

    for( i = 0; i < spawnPoints.Length; i++ )
    {
        if (spawnPoints*.transform.childCount == 0 )*
 *{*
 _gos.Add(spawnPoints*);*_
 _*}*_
 _*}*_
 _*return gos.ToArray();*_
_*}*_
_*```*_
// Add import.
import System.Collections.Generic;

// Add "function" keyword.
private function AvailableSpawnPoints() : GameObject[]
{
    // Add "var" and place "." between List and <GameObject>.
    var gos = new List.<GameObject>();

    for( i = 0; i < spawnPoints.Length; i++ )
    {
        if (spawnPoints*.transform.childCount == 0 )*
 *{*
 _gos.Add(spawnPoints*);*_
 _*}*_
 _*}*_
 _*return gos.ToArray();*_
_*}*_
_*```*_