how to find a value in array knowing the index ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By loloid


I can’t find a function that help me find a value in an array.

I have a basic array and i want to return the 2nd or 3rd (not the first or last) value in it.

Basically, i know the index, how do i know the value ?

Thanks for your help,

P.S : sorry if my english is bad, i’m not a native speaker :slight_smile:

:bust_in_silhouette: Reply From: kidscancode
var array = ["a", "b", "c", "d"]

Arrays are indexed from 0, so if I want the second value:

var x = array[1] # returns "b"

The details of working with arrays are documented here: