Lably
Skip to content

Comparison of programming languages (array)

List of programming language comparisons

  • 2 min read
  • 3 chapters

Related on Lably

Through Matrix (mathematics) and Syntax (programming languages)

Syntax

Array dimensions

The following list contains syntax examples of how to determine the dimensions (index of the first element, the last element or the size in elements).

Some languages index from zero. Some index from one. Some carry no such restriction, or even allow indexing by any enumerated type, not only integers.

Indexing

The following list contains syntax examples of how to access a single element of an array.

Slicing

The following list contains syntax examples of how a range of element of an array can be accessed.

In the following table:

  • first – the index of the first element in the slice
  • last – the index of the last element in the slice
  • end – one more than the index of last element in the slice
  • len – the length of the slice (= end - first)
  • step – the number of array elements in each (default 1)

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication