I passing some params from by back to my front through environment params. No problems with strings but I'm getting crazy to do it with an array.
- Initial array format =
["one", "two", "three"] - when I pass it to the front, it return
"["one", "two", "three"]" - So to solve thats, a little js tricks (
.replace(/"/g, "'")) give me that format :"['one', 'two', 'three']"
And now, I would like to transform it to a basic array javascript like this : ['one', 'two', 'three']
Any ideas to solve that (with less code would be great obviously !)
<ENV_VAR> = JSON.serialize(...)and "parse" it withJSON.parse(<ENV_VAR>)on the frontend.