문제
Map, Filter, Reduce - Code Exercises | CroCoder
Map, filter and reduce are the most useful array methods to manipulate arrays and often the hardest to master. Try to solve the given exercises!
www.crocoder.dev
정답
const input = "George Raymond Richard Martin";
const arr = input.split(" ");
console.log(arr.map(x => x[0]).join(""));
const input = "George Raymond Richard Martin";
const arr = input.split(" ");
const answer = arr.map(x => x.slice(0, 1)).join("");
console.log(answer);