- Home /
Unknown Identifier 'List'
var myVariable = new List.<int>();
Trying to figure out how to use lists. What am I doing wrong?
Answer by CostelloNicho · Nov 22, 2012 at 06:39 PM
Lists don't exist in javascript, but javascript arrays can get all the same functionality. You should read through this page to choose the best kind of array.
Which Kind Of Array Or Collection Should I Use?
Since you didn't specify which language you are writing in ( I just assumed due to the dynamic typing ), here is what this would look like in C#:
List<int> myVariable = new List<int>();
Ah… I'd read that article and it said the generic list worked with javascript but I didn't notice that it required the header at the top of the file! D'oh! Thanks :)
Your answer
Follow this Question
Related Questions
IComparable error due to float 1 Answer
How do I search a list for a Vector3? 1 Answer
JavaScript: ``Unknown Identifier`` 3 Answers
NullReferenceExeption 1 Answer
I got a major question 1 Answer