Need help or advice ? Come to the Icy club ! - Every Wenesday morning from 9h30 to 12h30 - Francois Jacob Building - Main hall - Pasteur
Register

Use JS Arrays

by tprovoost / Thomas Provoost

Shows the different manners to create and access an Array in JavaScript.

version 1 (last version):

download to use and modify in Icy. How do I use scripts ? A Problem ? ask the community.
Changelog for this version: initial version
/*
 * Declare an array can be done in various ways:
 * 	- empty array and access it to put values
 *	- array initialized with values
 */
// those two methods are equal
a = new Array()
a = []

// those two methods are equal
a = new Array("hello", "world", "!")
a = ["hello", "world", "!"]

// ---------------
// Access an array
// ---------------
a[0] = "hello"	// put "hello" in the first element (index zero)
a[1] = "world"	// put "world" in the second element 
a[2] = "!"	// put "!" in the second element

println(a[0])  // this displays the first element

This script has no documentation. A Problem ? ask the community.



Icy script publication Id : V1F5B1