Question 29/500 - Problem Solving in JavaScript



Question 29: Create a function that changes specific words into emoticons. Given a sentence as a string, replace the words smile, grin, sad and mad with their corresponding emoticon.


Note:

- The sentence always starts with "Make me".

- Solve this without using conditional statements like if/else or switch.


Problem



Solution


Why should I follow this series and how will I benefit from it?

We are on a mission to solve 500 problems using JavaScript. We would start from very easy questions and gradually shift towards medium, hard and also very hard questions. 


By following this series you will also be able to learn DSA using JavaScript. Moreover, we will also solve questions from leetcode and other problem solving websites.


Please  follow and share this series on your story so that it can be beneficial for others as well.


Follow @devtipsdaily for more!


Post a Comment

Previous Post Next Post