Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (34 loc) · 973 Bytes

record.map.md

File metadata and controls

41 lines (34 loc) · 973 Bytes

Record.map

The sort function is established to change the array data format.

Sample

	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"];
	}
});

API

CallingReturning
record .map ( mapping )Record
ParametersTypeDescription
mappingObjectThe mapping of ToBe and AsIs.
{
	newField1:oldField1,
	newField2:[oldField2, formatter, rounder],
	newField3:function(data){return String|Number|Date|Boolean;}
}