Anyone have any ideas why this gives an error in an webex connect evaluate node?
const originalArray = ["apple", "orange", "banana"];
const formattedArray = originalArray.map(fruit => ({ fruit }));
const myJson = JSON.stringify(formattedArray);
1;
It fails on line 2 - syntax error (<cmd>#2)
But the JavaScript looks OK? and the variable myJson should evaluate to:
[{"fruit":"apple"},{"fruit":"orange"},{"fruit":"banana"}]
Regards,
Gerry