Created
May 27, 2019 04:07
-
-
Save gndx/899339ac3843244632294f12cb7f74bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const products = [ | |
{ id: "1", name: "shirt", category: "clothing" }, | |
{ id: "2", name: "Sports Tennis", category: "accessories" }, | |
{ id: "3", name: "Casual shoes", category: "footwear" }, | |
{ id: "4", name: "skirt", category: "clothing" }, | |
{ id: "5", name: "tie", category: "clothing" } | |
] | |
let nameOfProducts = []; | |
for (let i = 0; i < products.length; i++) { | |
nameOfProducts.push(products[i].name); | |
} | |
console.log(nameOfProducts); // ["shirt","Sports Tennis","Casual shoes","skirt","tie"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment