Open swati-jagtap opened 3 years ago
const countries = ['Finland', 'Sweden', 'Denmark', 'Norway', 'IceLand'] const names = ['Asabeneh', 'Mathias', 'Elias', 'Brook'] const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] const products = [ { product: 'banana', price: 3 }, { product: 'mango', price: 6 }, { product: 'potato', price: ' ' }, { product: 'avocado', price: 8 }, { product: 'coffee', price: 10 }, { product: 'tea', price: '' }, ] countries.forEach((country)=>{ console.log(country); }) console.log("\n") //or countries.forEach((country)=>( console.log(country))) console.log("\n") //or countries.forEach(function(country) { console.log(country) })
9.1.3--Use forEach to console.log each country in the countries array.
output