How do you add an array to a Custom Editor in JavaScript?

There seems to only be examples for C#, but not for JavaScript. If anyone could supply a simple example it would be greatly appreciated. I’m sure others would also find it helpful.

Basically I’m just looking for an example of how to add an array to the Custom Editor. I’m not one to just ask for code, but there are literally no examples for JavaScript. I have searched the web all day. Something along the lines of what’s below.

//RegularScript.js
var someArray : GameObject[];

//RegularScript_Editor.js
@CustomEditor (RegularScript)
class RegularScript_Editor extends Editor 
{
     //Need some help with this part
     var someArray[] : boolean = !EditorUtility.IsPersistent (target);
            target.someArray = EditorGUILayout.ObjectField ("Some Array", target.someArray, GameObject[], someArray);
}

I ended up finding a solution.

Since it took me forever to figure this out, I’ll post it as an answer to save others from wasting their time like I did.

//Script.js
var myArray : GameObject[];

//EditorScript.js
@CustomEditor (Script)
class EditorScript extends Editor {
    EditorGUILayout.PropertyField(serializedObject.FindProperty("myArray"), true);
}