0
var array = ["Charizard,Pikachu,Glalie,Delfox"];

I tried to use the split() method except that only affects string variables and not arrays.

My ultimate goal is to make array = ["Charizard","Pikachu","Glalie","Delfox"];

Here's a picture that describes the problem

Code Lღver
  • 15,573
  • 16
  • 56
  • 75

1 Answers1

1

You can retrieve the value of the array an split it using as delimiter the comma ','

var array = ["Charizard,Pikachu,Glalie,Delfox"];
console.log(array[0].split(','))
Roberto Russo
  • 834
  • 10
  • 22