Professional Documents
Culture Documents
ES6 Tutorial
ES6 Tutorial
const ages = [33, 12, 20, 16, 5, 54, 21, 44, 61, 13, 15, 45, 25, 64, 32];
// forEach
// companies.forEach(function(company) {
// console.log(company.name);
// });
// filter
const eightiesCompanies = companies.filter(company => (company.start >= 1980 && company.start < 1990));
// map
// sort
// Sort ages
// const sortAges = ages.sort((a, b) => a - b);
// console.log(sortAges);
// reduce
// let ageSum = 0;
// for(let i = 0; i < ages.length; i++) {
// ageSum += ages[i];
// }
// Combine Methods
console.log(combined);