Convert string to array
User convert , seperated string to array in javascript Assistant You can use the `split()` method in JavaScript to convert a comma-separated string into an array. Here's an example: const str = "apple,banana,cherry"; const arr = str.split(","); console.log(arr); // Output: ["apple", "banana", "cherry"] ### Notes: 1. **Trim Whitespace**: If the string has spaces around the […]