Cannot read Array Length

Hellow,
It would seems I cannot read the length of an array when it’s created this way.

var myArray = new Array();

When I do

print (myArray.lenght);

it returns me this error.

Null
UnityEngine.MonoBehaviour:print(Object)
cameraRail:printDistances() (at Assets/Scripts/Camera/cameraRail.js:35)
UnityEngine.Component:SendMessage(String)
cameraRail:calDistances() (at Assets/Scripts/Camera/cameraRail.js:29)
UnityEngine.Component:SendMessage(String)
cameraRail:Start() (at Assets/Scripts/Camera/cameraRail.js:11)

Any idea what is going on?

Here it is your answer:

using C# :

private int[] testArray = new int[5];
print(testArray.Length);

using JS:

public var testArray = Array(5);
print(testArray.length);

There is a typographical error in your code.