John Abraham
John Abraham

Reputation: 18781

Understanding the first Line from inside angular v2.0.0.0-alpha.22.ts (Lists vs Arrays)

I have some free time right now and decided to look at Angular 2 Quickstart

Inside of the typings/angular2/angular2.d.ts file on line 11:

interface List<T> extends Array<T> {}

I understand there is a lot going on in this line:

Question:

What is the difference between List and Array through the lens of javascript/ts?

When should I consider using Lists vs Arrays?

What would be an example of using a List vs an Array?

Upvotes: 2

Views: 60

Answers (1)

basarat
basarat

Reputation: 275847

What is the difference between List and Array through the lens of javascript/ts?

None.

When should I consider using Lists vs Arrays?

Use array. List is just an optional naming (effectively an alias).

What would be an example of using a List vs an Array?

Generally just use Array.

Upvotes: 1

Related Questions