Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Dec 20, 2014 at 07:04 PM by meat5000 for the following reason:

Problem outdated

avatar image
0
Question by BrandonLayton · Sep 12, 2011 at 01:18 AM · javascriptlistjavascript-specific

Javascript - List

I am trying to find a List like function for Javascript, but to no avail. I need to be able to create a custom list like List. I know you can do it in C# but I need it in Javascript.

Hopefully there is something similar. Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

  • Sort: 
avatar image
1

Answer by SisterKy · Sep 13, 2011 at 10:54 AM

I think you are looking for this...?
http://www.unifycommunity.com/wiki/index.php?title=Which_Kind_Of_Array_Or_Collection_Should_I_Use%3F

Greetz, Ky.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image japanitrat · Sep 13, 2011 at 11:51 AM 0
Share

uh, Unity (or $$anonymous$$ono) adds features like those collections to JS? That is crazy, actually

avatar image SisterKy · Sep 13, 2011 at 11:59 AM 0
Share

I take that as crazy-in-a-good-way? ^^

avatar image japanitrat · Sep 13, 2011 at 12:13 PM 0
Share

indeed ;) but i wonder where this is documented (except for the collections)

avatar image
1

Answer by meat5000 · Dec 20, 2014 at 06:35 PM

Huh? What? I have no problem using lists in uJS. Is this a recent thing, then?

 import System.Collections.Generic;
 
 public var myList : List.<TYPE>; // Insert TYPE
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Dec 20, 2014 at 07:02 PM 0
Share

See the date on the question? 2011. (Although I believe generics did work back then.)

avatar image meat5000 ♦ · Dec 20, 2014 at 07:04 PM 0
Share

Aye that's why I asked if Lists in uJS were recent :)

Anyhoo - Closing

avatar image
-1

Answer by timrox99 · Feb 26, 2013 at 06:04 AM

This might help: http://www.w3schools.com/js/js_obj_array.asp

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gregorio80 · Dec 20, 2014 at 06:29 PM 0
Share

20/12/2014 - error 404 :(

avatar image meat5000 ♦ · Dec 20, 2014 at 06:36 PM 0
Share

Yeah, don't learn Unity coding from W3Schools JS. It's not what you need.

avatar image
0

Answer by japanitrat · Sep 12, 2011 at 01:25 AM

If you are speaking of C# then "List" is not a function but a collection. In JS you can use Array which serves the same purpose (for instance you can push and pop elements dynamically), although it does provide the same amount possibilities.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BrandonLayton · Sep 12, 2011 at 09:46 PM 0
Share

Array is not really what I need. I need something that do the equivalence of List<$$anonymous$$yClass>.

avatar image japanitrat · Sep 13, 2011 at 09:22 AM 0
Share

JavaScript has no generics, so the answer is no. But you can put all kinda things into a JS Array, its just not type-safe.

Edit: as pointed out by $$anonymous$$y, Unity or $$anonymous$$ono do enhance the common JS stuff.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

JS Argument out of range 1 Answer

Is there eval() for C#? 2 Answers

How to set parents of all objects in an array? 1 Answer

List problem? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges