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?

Thanks!

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()
{
    elementList.Add("Hello");
    elementList.Add("World!");

    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.

http://wiki.unity3d.com/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use%3F

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.