pick out the matching route through the boarding point selected by the user
let data=[
{
name:"a",
line:[
{type:"up",place:""},
{type:"up",place:""},
{type:"up",place:""},
{type:"down",place:""},
{type:"down",place:""}
]
},
{
name:"b",
line:[
{type:"up",place:""},
{type:"up",place:""},
{type:"up",place:""},
{type:"down",place:""},
{type:"down",place:""}
]
},
{
name:"c",
line:[
{type:"up",place:""},
{type:"down",place:""},
{type:"down",place:""}
]
},
]
let upName=""
let downName=""
data upName downName
data.forEach(function (item) {
item.line.forEach(function (val) {
if(val.type==="up" && val.place===upName){
}
})
})