add GameObject in GameObject[] (js)

Help please need add GameObject in GameObject

I translated script from c# in js and this 2 functions not working and i don’t know what need write here

var objs : GameObject;

objs.Add(go);

and

var count : int = objs.Count;

i know can use objs.Length but if some object in objs = null - error

Make your variable a List and then it will work.

   import System.Collections.Generic;

  ...

   var objs = new List.<GameObject>();

Technically you can use Array.Resize for built-in arrays if you want to make them bigger, but if you’re doing that, you’re usually better off with List.