字符串转数组

  1. let myData = 'Manchester,London,Liverpool,Birmingham,Leeds,Carlisle';
  2. let myArray = myData.split(",");

数组转字符串

  1. let dogs = ["Rocket","Flash","Bella","Slugger"];
  2. let s = dogs.toString();

结果:image.png