does anyone know why my Reduce function returning ...
# suitescript
k
does anyone know why my Reduce function returning weird string object ?
b
thats simply how it works, all objects will be turned into strings using JSON.stringify
use JSON.parse (multiple times, once for each element)
k
Untitled
I tried but no luck
b
context.values is an array
you want to parse the elements of the array, not the array itself
k
this is how system returning ["[\"1783\",\"15.30\"]","[\"1784\",\"6.03\"]"]
b
looks reasonable, how are you parsing the array elements
k
Damn, finally got it man
Copy code
items.forEach(function (ress) {
    var parseItems = JSON.parse(ress);
    log.debug("Get Valuess of Items:", parseItems[0])

});
Just looped through elements and parsed elements
it works