Answers for "add quotes to array items"

0

add quotes to array items

var array1 = ["test, test1"];

 var array = array1[0].split(',');
array = array.map(i => '"' + i + '"');
alert(array)
 Run code snippet
Posted by: Guest on October-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language