var string = "Chemistry,English,History";
Sir i want to convert it to an array like:
var subjects= ["Chemistry","English","History"];
using jQuery
var string = "Chemistry,English,History";
Sir i want to convert it to an array like:
var subjects= ["Chemistry","English","History"];
using jQuery
No need of jquery. Just use .split() function to achieve this.
let string = 'Chemistry,English,History';
let arr = string.split(',');
console.log(arr)