Link to home
Start Free TrialLog in
Avatar of GrrWolfie
GrrWolfieFlag for United States of America

asked on

How to convert a multi-dimensional array into an eval() compatible string.

So I have a webpage where a user can dynamically create their own multi-dimensional array. I need to be able to convert this array into a string for saving that'll work with eval() to recreate that same array.

Example:
var myarray=["A", ["1","2"],"B","C"]; (representing the user's dynamically created array if it was written out)
Needed Output: ["A", ["1","2"],"B","C"]

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GrrWolfie

ASKER

Works perfect! Thankyou! :) :)