I would like to take this:
var sneed = { feed: "and", seed: [ "formerly", "chucks" ] };
And produce this:
feed="and" seed="formerly,chucks"
But how? It needs to work in older javascript versions.
My solution:
function arg( d = {} ) {
var sl = [];
for ( var key in d ) {
sl.push( key + '="' + d[key] + '"' );
}
return sl.join(" ");
}
The problem is, that this will quickly fail if any " is found within any of the strings, which leads me to ask if there is actually a simpler more straightforward way of doing this.
Thanks.