Access List Item

Category:Variables

Select List Item

The block used to select an element, or item, from a list.

To select an item from a list and use it, just type in the name of the list you want to select from, and the index number that you want.

Examples

var favoriteMusicGenres = ["Rock", "Jazz", "Funk"];

console.log(favoriteMusicGenres[0]);

Syntax

list[index];

Returns

The item from the list.

Found a bug in the documentation? Let us know at documentation@code.org