Problem 1: Can this be achieved in javascript?
value = "['iPhone', 'iBall']"
to
value = ['iPhone', 'iBall']
Problem 2: To make it harder, The values are encoded:
value = "['iPhone', 'iball']"
Does this help ?
var value = "['iPhone', 'iBall']";
value = JSON.parse(value.replaceAll(`'`, `"`));
console.log(value);
value = "['iPhone', 'iball']";
value = JSON.parse(value.replaceAll(`'`, `"`));
console.log(value);
console.log(typeof(value));
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments