GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Flussdiagramm

Array data type overview

Kostas Diakogiannis Web Developing Junior Certificate Englisch

Inhalt des Flussdiagramms

  1. JavaScript ArraysType

  2. Arrays Data Type

    Arrays are exactly like objects, and in fact it is of object data types, but instead being accessed by key-value pairs, their individual values hold no keys and can be accessed by the index number value that starts from 0.

    let foods = ['chocolate', 'apple', 'orange'];

    console.log(foods[0]) // prints the chocolate as we start counting index from position 0.

    Arrays can also be iterated either with a traditional loop with an index from 0 to the length of the array or with a for - of loop.learn more about how looping through array here.

    Arrays come with tons of built in methods to change and manipulate their values. Some of them are:

    foods[1] = 'meat' // Changes the food to index 1, from apple to meat.

    foods,push('apple') // Adds an apple to the end of the foods array.

    foods.length // Prints the length of the array (in this case 4)

    foods,unshift('Pasta') // Inserts pasta to index 0 and every element goes an index up. (from 0 to 1, from 1 to 2 etc).

    foods.shift('pasta') // remove past from index 0 and every element goes an index down.

    foods.pop() // The opposite of push, this removes the last element from an array.

    foods.splice(2, 1) // This removes one element starting from index 2. Removes the orange in other words.

    For more array methods like join, reverse, map, filter, find, indexOf, reduce, and many many more check out here!

Informationen

Beschreibung
Junior Certificate Web Developing Flussdiagramm am Array data type overview, erstellt von Kostas Diakogiannis am 15/10/2018.
Aufrufe
4
Verlauf
  • Erstellt von Kostas Diakogiannis · 12 Okt 2018
  • Kopiert von Kostas Diakogiannis · 12 Okt 2018
  • Kopiert von Kostas Diakogiannis · 12 Okt 2018
  • Kopiert von Kostas Diakogiannis · 15 Okt 2018
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck