Little problem with an array

I have this function to handle my paused game but when I try to add the playing sounds too the playingSoundsArray with playingSoundsArray.Add(sound) I get a console compile error: "Add’ is not a member of ‘UnityEngine.AudioSource[ ]’.

function PauseMenuCall()
{
	if(singleplay)
	{
		var playingSoundsArray :AudioSource[];
		
		if(!pauseMenuToggle)
		{
			// Make the pause text pop up and stop time.
			pauseMenuToggle = true; 
			Time.timeScale = 0 ;
			
			// Next pause all running audio clips and add them to the playingsounds array so we can enable them again later.
			var allSounds :AudioSource[]= FindObjectsOfType(AudioSource);
			for (var sound : AudioSource in allSounds)
			{
				if(sound.isPlaying)
				{
					playingSoundsArray.Add(sound);
					sound.Pause();
				}
			}
		}
		else 
		{
			pauseMenuToggle = false;
			Time.timeScale = 1 ;
			AudioListener.volume = oldVolume;
			rMainCamera.EnableCamControl();
			for (var playingsound : AudioSource in playingSoundsArray)
			{
				playingsound.Play();
			}
		}
	}
}

Array primitives do not have an Add method. You’ll have to either add manually by keeping track of the index and using playingSoundsArray = sound, or use a higher-level structure such as an ArrayList.

To have .Add() method you would have to use something like a List that’s dynamic and lets you add new elements at runtime.

this is the C# syntax, JS should be similar.

using System.Collections.Generic;
List. playingSoundsArray = new List();

They act like an array too, so you can do indexing - playingSoundsArray[index]