Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to convert string to alternate case in javascript

const alternateCase = () => {
  var newText = text.toLowerCase().split("");
  for (var i = 0; i < newText.length; i += 2) {
    newText[i] = newText[i].toUpperCase();
  }
  return newText.join("");
};
Source by www.textbotonline.com #
 
PREVIOUS NEXT
Tagged: #convert #string #alternate #case #javascript
ADD COMMENT
Topic
Name
3+6 =