【发布时间】:2019-11-16 12:31:00
【问题描述】:
你好有这个数组:
[ {
"Navn": "Long Island Iced Tea",
"Nummer": "2",
"Glas i ml": "250",
"Instruktioner": "",
"a": "Hæld is i glasset",
"b": "pynt med en skive lime",
"Ingredienser": [
{
"Type": "Spiritus",
"Del1": [
{
"Cointreau": 20
}
],
"Del2": [
{
"Gin": 20
}
],
"Del3": [
{
"Rom_Lys": 20
}
],
"Del4": [
{
"Tequila": 20
}
],
"Del5": [
{
"Vodka": 20
}
]
},
{
"Type": "Vand/Juice",
"Del1": [
{
"Cola": 40
}
],
"Del2": [
{
"Sprite": 20
}
]
},
{
"Type": "Mixer",
"Del1": [
{
"Lime_Sirup": 20
}
]
}
]
}]
它用于鸡尾酒机。
我想通过“Del1”搜索(示例)“Rom_Lys”&“Cola”&“Vodka”来过滤它,然后输出一个具有这些规范的新数组。
我尝试搜索论坛,但似乎找不到有用的东西。玩过过滤器和包含,但想不出任何有用的东西。
谢谢!
【问题讨论】:
标签: javascript arrays json sorting