我想从另一个数组中的多个元素中选择一个元素。 该数组如下。在javascript中,如何选择数组中的元素到另一个数组中
{
"f": "Book2.csv",
"v": 0,
"vs": ["Year", "Month", "Customer_ID", "Collateral", "Exposure_amount"],
"xs": ["Customer_type", "Region", "Collateral_type", "Collateral_value"],
"y": 1,
"x": 0,
"ys": ["Customer_type", "Region", "Collateral_type", "Collateral_value"]
}
我尝试在“xs”数组中获得“Customer_type”。
var custype = data["xs"]data["x"]
但发生了异常。
SyntaxError: missing ; before statement
我该如何解决这个问题?
加上','在每个语句结束。 – prasanth
它是JS还是PHP? –