Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.21 KB

practice.md

File metadata and controls

48 lines (35 loc) · 1.21 KB

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 here

const wrappedStrings = pokemon.map(a => <p>${a}</p>) console.log(wrappedStrings)