To parse it you need to use double quotes instead of single.

This should work:

services = '["service1", "service2", "service3"]'
JSON.parse(services)
Answer from Erick R Soto on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › from
Array.from() - JavaScript - MDN Web Docs
Python, Clojure, etc.) const range = (start, stop, step) => Array.from( { length: Math.ceil((stop - start) / step) }, (_, i) => start + i * step, ); // Generate a sequence of numbers from 0 (inclusive) to 5 (exclusive), incrementing by 1 range(0, 5, 1); // [0, 1, 2, 3, 4] // Generate a sequence of numbers from 1 (inclusive) to 10 (exclusive), incrementing by 2 range(1, 10, 2); // [1, 3, 5, 7, 9] // Generate the Latin alphabet making use of it being ordered as a sequence range("A".charCodeAt(0), "Z".charCodeAt(0) + 1, 1).map((x) => String.fromCharCode(x), ); // ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] The from() method can be called on any constructor function that accepts a single argument representing the length of the new array. js ·
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › string-to-array-in-javascript
JavaScript - Convert String to Array - GeeksforGeeks
August 5, 2025 - The Array.from() method can convert a string into an array of characters. This method is especially useful if you want to create an array from an iterable object, like a string, without needing to specify a separator.
🌐
Flexiple
flexiple.com › javascript › string-to-array-javascript
Converting string to array JavaScript? - Flexiple Tutorials - Flexiple
March 11, 2022 - Initially, the only method available for this was split(). However, after the addition of ES6, alternative methods were introduced that could be used to convert string to array. Although in this tutorial we focus on the method using split(), the other methods that can be used are Spread, Object.assign, and Array.from.
🌐
ReqBin
reqbin.com › code › javascript › jaarxzpl › javascript-string-to-array-example
How do I convert string to array in JavaScript?
March 9, 2023 - JavaScript provides many built-in functions for reducing, reversing, merging, joining, slicing, containing, cloning, inserting, clearing, and copying arrays. You can also get a sum of array elements and convert the array to JSON. In JavaScript, you can use several ways to convert a string to an ...
🌐
CoreUI
coreui.io › answers › how-to-convert-a-string-to-an-array-in-javascript
How to convert a string to an array in JavaScript · CoreUI
September 22, 2025 - Use the split() method to convert a string into an array of characters or words in JavaScript efficiently.
🌐
W3Schools
w3schools.com › jsref › jsref_split.asp
JavaScript String split() Method
cssText getPropertyPriority() getPropertyValue() item() length parentRule removeProperty() setProperty() JS Conversion ... let text = "How are you doing today?"; const myArray = text.split(" "); let word = myArray[1]; Try it Yourself » ... ...
🌐
DEV Community
dev.to › sanchithasr › 6-ways-to-convert-a-string-to-an-array-in-javascript-1cjg
6 Ways to Convert a String to an Array in JavaScript - DEV Community
September 24, 2022 - It also works well with Regex too. You can find the complete documentation of split() here. This way flawlessly separates the string elements into an array but it has its limitations.
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › jsref_tostring_array.asp
JavaScript Array toString() Method
cssText getPropertyPriority() ... ... const fruits = ["Banana", "Orange", "Apple", "Mango"]; let text = fruits.toString(); Try it Yourself » · The toString() method returns a string with array values separated by commas...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › split
String.prototype.split() - JavaScript - MDN Web Docs
const str = "The quick brown fox jumps over the lazy dog."; const words = str.split(" "); console.log(words[3]); // Expected output: "fox" const chars = str.split(""); console.log(chars[8]); // Expected output: "k" const strCopy = str.split(); console.log(strCopy); // Expected output: Array ...
🌐
SamanthaMing
samanthaming.com › tidbits › 83-4-ways-to-convert-string-to-character-array
4 Ways to Convert String to Character Array in JavaScript | SamanthaMing.com
Also, when you see it pop up in someone's codebase, you will understand it with ease 👍‬ · const string = 'word'; // Option 1 string.split(''); // Option 2 [...string]; // Option 3 Array.from(string); // Option 4 Object.assign([], string); ...
🌐
Stack Abuse
stackabuse.com › how-to-convert-a-string-to-an-array-in-javascript
How to Convert a String to an Array in JavaScript
August 5, 2025 - ... We could split it on each whitespace (breaking it down into words), or on every character, or any other arbitrary delimiter, such as 'p': // Split string using a whitespace let array1 = quote.split(' '); console.log(array1); // ["I", "am", "unstoppable!"] // Splitstring using an empty string ...
🌐
ReqBin
reqbin.com › code › javascript › ot8wzla9 › javascript-array-to-string-example
How do I convert array to string in JavaScript?
November 21, 2023 - JavaScript provides many built-in functions for containing, reducing, reversing, merging, joining, slicing, cloning, copying, clearing, and inserting arrays. You can also get a sum of array elements and convert an array to JSON. In JavaScript, a string is a sequence of characters enclosed in ...
🌐
Medium
medium.com › @jsomineni › 3-ways-to-convert-string-into-array-in-javascript-3eacfc729cf6
3 ways to convert String into Array in JavaScript | by Jayanth babu S | Medium
September 1, 2024 - JavaScript provides several methods to achieve this. In this blog, we’ll explore three of the most popular ways to convert a string into an array: using the split() method, Array.from(), and the spread operator (...).
🌐
Board Infinity
boardinfinity.com › blog › string-to-array-conversion-in-javascript
String to Array conversion in JavaScript | Board Infinity
January 3, 2025 - The second way of turning a string into an array in js is using the Array.from() method. This method constructs a new array instance out of an array-like or iterable object for example a string.
🌐
Codedamn
codedamn.com › news › javascript
How to convert a string to an Array in JavaScript?
November 14, 2022 - We can convert a string to an array using the object.assign() method in following way. Using this method will copy all the string properties to the new array. Let us understand it with the help of an example
🌐
Delft Stack
delftstack.com › home › howto › javascript › convert string to array javascript
How to Convert String Into Array in JavaScript | Delft Stack
July 10, 2025 - For example, create a variable num and store a value 1234 as a string in the variable. Call the from() method with an object Array and supply the num variable as the parameter in the function.
🌐
CodingNomads
codingnomads.com › javascript-array-to-string-conversion
JavaScript Array-String Conversion
It takes an optional map function as an argument, which allows you to manipulate the elements in the array. This is useful if you want to convert the string to an array of numbers, for example:
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-string-of-objects-to-array-in-javascript
How to Convert String of Objects to Array in JavaScript ? - GeeksforGeeks
July 23, 2025 - Example: This example shows the use of the Function constructor to convert a string of objects to an array of objects. ... let str = '[{"company":"Geeks", "contact":"+91-9876543210"}, {"address":"sector 136", "mail":"xys@geeksforgeeks.org"}]'; ...