GoConqr has a new look! Let us know what you think.

Flashcards

Array methods

milly larcen Array English 2 cards

Cards in this deck (2)

  1. 1forEach()data.forEach(function(item, index, array) {
    console.log(item.id, item.title);
    });
    When data is array, `item` is the array item; `index` is the array item index; and the last argument, `array`, is the original array. So, for every item in array, this function will be executed once.
  2. 2map()`map()` method returns a new array
    var products = [{
    id: 0, name: 'Product 1'},{
    id: 1, name: 'Product 2'}];
    var productsIds = products.map(
    product => product.id);
    console.log(productsIds); // [0, 1]

Information

Description
Array Flashcards on Array methods, created by milly larcen on 14/04/2020.
Created by
milly larcen · Apr 2020
Updated
Apr 14, 2020
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?