Last active
March 21, 2019 06:41
-
-
Save potikanond/fc7d0c7a5a93cdfacff2cbfcb79365b8 to your computer and use it in GitHub Desktop.
Starting code - JavaScript Array and High-order functions
This file contains hidden or 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
| // Add the following element at the end of <body> element in an html file | |
| // <script src="main.js"></script> | |
| const companies= [ | |
| {name: "Company One", category: "Finance", start: 1981, end: 2004}, | |
| {name: "Company Two", category: "Retail", start: 1992, end: 2008}, | |
| {name: "Company Three", category: "Auto", start: 1999, end: 2007}, | |
| {name: "Company Four", category: "Retail", start: 1989, end: 2010}, | |
| {name: "Company Five", category: "Technology", start: 2009, end: 2014}, | |
| {name: "Company Six", category: "Finance", start: 1987, end: 2010}, | |
| {name: "Company Seven", category: "Auto", start: 1986, end: 1996}, | |
| {name: "Company Eight", category: "Technology", start: 2011, end: 2016}, | |
| {name: "Company Nine", category: "Retail", start: 1981, end: 1989} | |
| ]; | |
| const ages = [33, 12, 20, 16, 5, 54, 21, 44, 61, 13, 15, 45, 25, 64, 32]; | |
| for(let i = 0; i < companies.length; i++) { | |
| console.log(companies[i]); | |
| } | |
| // forEach | |
| // filter | |
| // map | |
| // sort | |
| // reduce | |
| // Combine Methods | |
| // console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment