// Question 1 const bills = [ {date: '2018-01-20', amount: '220', category: 'Electricity'}, {date: '2018-01-20', amount: '20', category: 'Gas'}, {date: '2018-02-20', amount: '120', category: 'Electricity'} ];
// Answer const getCategoryList = (inputObject) => { let categoryList = []; inputObject.forEach(value => { if (!categoryList.includes(value.category)) { categoryList.push(value.category); } }); return categoryList; };
// usage console.log(getCategoryList(bills));
// Question 2 let theString = 'ama'; for (let character of theString.toUpperCase()) { console.log(character); }