A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!
Let's chat: @nairihar
Post #3145
2.2K
CHALLENGE
const str = " Hello, World! ";
const result = str
.trim()
.split(", ")
.map((word, i) => {
return i === 0
? word.toUpperCase()
: word.replace(/!$/, "").split("").reverse().join("") + "?";
})
.join(" | ");
const [first, ...rest] = result.split(" | ");
const final = `${first} | ${rest.join(" & ")}`;
console.log(final);
- 👍 2
- ❤ 1
- 🔥 1


