Skip to content

Instantly share code, notes, and snippets.

@gunlinux
Created December 31, 2025 17:43
Show Gist options
  • Select an option

  • Save gunlinux/c64863790f854c1c1b9b0418c27a78ed to your computer and use it in GitHub Desktop.

Select an option

Save gunlinux/c64863790f854c1c1b9b0418c27a78ed to your computer and use it in GitHub Desktop.
// BEGIN (write your solution here)
const makeItFunny = (str, n) => {
let i = 0;
let out = '';
while (i < str.length) {
if (i % n === 0) {
out = `${out}${str[i].toUpperCase()}`
} else {
out = `${out}${str[i].toLowerCase()}`
}
i++;
}
return out;
}
// END
export default makeItFunny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment