Advertisement
CR7CR7

stringToArray

Sep 18th, 2022
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let greeting1 = 'hello';
  2. let array1 = greeting1.split('');
  3.  
  4. console.log(array1);
  5.  
  6. let greeting2 = 'h,e,l,l,o';
  7. let array2 = greeting2.split(',');
  8.  
  9. console.log(array2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement