List of floats in JavaScript?

Is there no inbuilt functionality for lists in JavaScript? I heard about the List., but is there something I need to import to use that? How do I import “that” something? Am I missing something?


Here’s a simple example of List usage and the necessary import.

#pragma strict

import System.Collections.Generic;
var elementList :List.<String> = new List.<String>();

function Start()

    print(elementList[0] + " " + elementList[1]);

With any JavaScript question, I have to make the recommendation that you switch to C#. At the end of the day it’s up to you which language you use, but personally I find C# causes fewer headaches.

If you’re going to be using Unity, you need to be familiar with .NET. List<T> Class (System.Collections.Generic) | Microsoft Learn The language isn’t relevant.