I have the following string and array:
var message = 'This is a @[20] very fun, @[75] evening.';
var array_values = {"20": "really", "112": "extreme", "75": "happy"};
How do I replace the @[number] occurrences with the corresponding array values, to get this:
message = 'This is a really very fun, happy evening.';
Thanks!
array_values
is not an array....array_values
is an object. If you want an array, runObject.keys(array_values)
to get an array containing the keys of that object.