我在json中减去这可能吗?
@employees = [
{
"name": "Fullname1"
"vl": "Vacation Leave",
"vl_days": "15.0",
"sl": "Sick Leave",
"sl_days": "10.0",
"bday": "Birthday",
"b_day":"1.0",
"credit_vl":"12.0",
"use_vl": "vl_days - credit_vl"
}
答案 0 :(得分:1)
我在你的问题中假设]
。没有这个是不可能的。
employees = [
{
"name": "Fullname1",
"vl": "Vacation Leave",
"vl_days": "15.0",
"sl": "Sick Leave",
"sl_days": "10.0",
"bday": "Birthday",
"b_day":"1.0",
"credit_vl":"12.0"
}];
var use_vl=(employees[0].vl_days-employees[0].credit_vl);
employees[0].use_vl=use_vl;
console.log(employees);