const nums = [1, 2, 3, 4, 5] // --> [1, 4, 9, 16, 25] // Your code here
const squared = nums.map(e => e*e); console.log(squared);
const squares = nums.map(function(num) {
return num * num;
})
const names = ["alice", "bob", "charlie", "danielle"] // --> ["Alice", "Bob", "Charlie", "Danielle"] // Your code here const capitalStrings = names.map(s => s.charAt(0).toUpperCase() + s.slice(1)) console.log(capitalStrings)
const capitalize = names.map(function(name){
return name[0].toUpperCase() + name.slice(1);
})
const pokemon = ["Bulbasaur", "Charmander", "Squirtle"] // --> ["
Bulbasaur
", "Charmander
", "Squirtle
"] // Your code hereconst wrappedStrings = pokemon.map(a => <p>${a}</p>
)
console.log(wrappedStrings)