Complete the code to create a new array with each number doubled using the map method.
const numbers = [1, 2, 3]; const doubled = numbers.[1](num => num * 2); console.log(doubled);
Complete the code to convert all names in the array to uppercase using map.
const names = ['alice', 'bob', 'carol']; const upperNames = names.[1](name => name.toUpperCase()); console.log(upperNames);
Fix the error in the code to correctly double each number using map.
const nums = [4, 5, 6]; const doubled = nums.map(num => num [1] 2); console.log(doubled);
Fill both blanks to create an array of squares of even numbers only.
const nums = [1, 2, 3, 4, 5]; const squares = nums.filter(n => n [1] 2 === 0).[2](n => n * n); console.log(squares);
Fill all three blanks to create an array of uppercase names longer than 3 letters.
const names = ['Ann', 'Beth', 'Cara', 'Dan']; const result = names.[1](name => name.[2]()).[3](name => name.length > 3); console.log(result);
