Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const makeItFunny = (string, n) => {
- let i = 0;
- let result = '';
- while (i < string.length) {
- if ((i + 1) % n === 0) {
- result += `${string[i].toUpperCase()}`;
- } else {
- result += `${string[i]}`;
- }
- i++;
- }
- return result;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement