The sort function is established to change the array data format.
var record = new Record([
{"data1":"hello world", "data2":123, "data3":new Date("2016/12/13") },
{"data1":"hello human", "data2":456, "data3":new Date("2016/12/14") }
]);
record.map({
"A":"data1",
"B":["data2","#,##0"],
"C":["data3","yyyy/MM/dd"],
"D":function(data){
return data["data1"]+data["data2"]+data["data3"];
}
});
Calling | Returning |
record .map ( mapping ) | Record |
Parameters | Type | Description |
mapping | Object | The mapping of ToBe and AsIs.
{
newField1:oldField1,
newField2:[oldField2, formatter, rounder],
newField3:function(data){return String|Number|Date|Boolean;}
}
|