getting "null" when using array. (javascript)

I’ve done plenty of arrays in python so I understand the concept behind them, but I’ve never done one in JavaScript and it is not working. When I Debug.Log a item in the array, it gives me null. My code is

var zero: AudioClip;
var one: AudioClip;
var two: AudioClip;
var three: AudioClip;
var four: AudioClip;
var five: AudioClip;
var six: AudioClip;
var seven: AudioClip;
var eight: AudioClip;
var nine: AudioClip;

var number = [zero,one,two,three,four,five,six,seven,eight,nine];

whenever I do Debug.Log(number[0]) it gives me null. What am I doing wrong?

is it an array of AudioClips? Or an array of Strings?

AudioClip :

var number : AudioClips[];

String :

var number : String[] = ["zero","one","two","three","four","five","six","seven","eight","nine"];

If I’m assuming correctly, you are trying to create an array of AudioClips from individual AudioClip components/variables.

You cannot do this outside a function, it would be something like :

var zero: AudioClip;
var one: AudioClip;
var two: AudioClip;
var three: AudioClip;
var four: AudioClip;
var five: AudioClip;
var six: AudioClip;
var seven: AudioClip;
var eight: AudioClip;
var nine: AudioClip;

var number : AudioClips[];

function Start()
{
	number = new AudioClips[10]; // declare the size of the array
	
	// assign values to the array
	number[0] = zero;
	number[1] = one;
	number[2] = two;
	number[3] = three;
	// etc etc
}

but if you’re doing that, why not just drag and drop the AudioClips directly into the array in the inspector?

Great resource on Arrays and Collections in Unity