From 36bad642c24726f63e276b9b80f6bf1b1b0973e4 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 22 Feb 2019 23:03:34 +0100 Subject: [PATCH] Add variable declaration (#34702) * Declare variable * Update guide/english/certifications/javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array/index.md Co-Authored-By: ojeytonwilliams --- .../use-the-map-method-to-extract-data-from-an-array/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array/index.md index 87b5e3f542..606b7d8028 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array/index.md @@ -14,7 +14,7 @@ array.prototype.map takes a function as in input and returns an array. The retur ## ![:rotating_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/rotating_light.png?v=3 ":rotating_light:") Intermediate Code Solution: ```javascript - rating = watchList.map( (item) => ({"title":item["Title"], "rating":item["imdbRating"]}) ); + const rating = watchList.map(item => ({title: item["Title"], rating: item["imdbRating"]})); ``` ### Code Explanation: Using ES6 notation, each item in array is processed to extract title and rating.