SHARE
TWEET

EvenOrOdd

a guest Sep 19th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. evenOrOdd(string,even){
  2.   var newString = "";
  3.   if(even){
  4.     for(var i=0;i<string.length;i=i+2){
  5.       newString.concat(string[i]);
  6.       }
  7.     }else{
  8.       for(var i=1;i<string.length;i=i+2){
  9.         newString.concat(string[i]);
  10.        }
  11.     }
  12.   return newString;
  13.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top