Thanks in advance!
System.Array.Resize is a template method and the only way I can get it to work with JS is to explicitly define the template parameter. So yes, your syntax was a bit off there, but here's how it should look:
Given myArray is initially 5, running this script will print "6". I hope this little snippet is self explainable but if you have questions, just post a comment to this answer and I or someone else will get back to you.
The code you posted would generate this error message:
The method clearly is there, it's just hidden as a template method (meaning you can replace the type of the array). The syntax for specifying the template parameter is added as