Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. function invertCase(str) {
  2. result = '';
  3. for (let i = 0; i < str.length; i++) {
  4. if (str[i] === str.toUpperCase()) {
  5. str[i] = str.toLowerCase()
  6. return i += result;
  7. }
  8. else if (str[i] === srt.toLowerCase()) {
  9. str[i] = str.toUpperCase()
  10. return i += result
  11. }
  12. }
  13. return result;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement