¡GoConqr estrena diseño! Cuéntanos qué te parece.

Diagrama de flujo

Array data type overview

Kostas Diakogiannis Web Developing Junior Certificate Inglés

Contenido del diagrama

  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!

Información

Descripción
Junior Certificate Web Developing Diagrama sobre Array data type overview, creado por Kostas Diakogiannis el 15/10/2018.
Visitas
4
Historial
  • Creado por Kostas Diakogiannis · 12 oct 2018
  • Copiado por Kostas Diakogiannis · 12 oct 2018
  • Copiado por Kostas Diakogiannis · 12 oct 2018
  • Copiado por Kostas Diakogiannis · 15 oct 2018
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?