Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

map every second character jaavascript

var str = 'hello world how ya doing?';

function toUpperCase(str) {
  return str.split('').map((v, i) => i % 2 == 0 ? v.toLowerCase() : v.toUpperCase()).join('');
}

console.log(toUpperCase(str));
Comment

PREVIOUS NEXT
Code Example
Javascript :: does kendo window content clear on close 
Javascript :: js jquery class ending with string 
Javascript :: remove property from object javascript 
Javascript :: javascript const 
Javascript :: javascript non primitive data types 
Javascript :: schema mongoose 
Javascript :: change color in react 
Javascript :: rotate13 text in javascript 
Javascript :: javascript remove everything after . 
Javascript :: get time in google apps script 
Javascript :: json schema beispiel 
Javascript :: clear input fild 
Javascript :: return then javascript 
Javascript :: A fatal JavaScript error has occurred. Should we send an error report 
Javascript :: remove text in div jquery 
Javascript :: How to have hotjar in react-hotjar 
Javascript :: remove array value by index js 
Javascript :: onclick remove textarea value 
Javascript :: jquery check if input is empty on keyup 
Javascript :: how to check if date is between two dates in javascript 
Javascript :: import bootstrap 4 in react 
Javascript :: select div with clas 
Javascript :: how to call api on load using hooks in react 
Javascript :: objeto con método javascript 
Javascript :: expressjs allow cors for all hosts and ports 
Javascript :: nohup nodemon 
Javascript :: javascript filter array return index 
Javascript :: nodejs get file stats 
Javascript :: reactt split a value and sepate 
Javascript :: comparing html text by using jquery 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =