我有一个“列表”,我想在一行“ if”语句中测试其所有元素的条件,就像这样:
const track = {
variable: 2,
something: (pass) => {
console.log(pass)
}
}
const string = JSON.stringify(track, (k,v) => {
if(typeof v === "function"){
return v.toString();
}
return v;
})
console.log('string',string)
该怎么做?
解决方案(感谢@pault和@ g.d.d.c):
if not(nx.has_path(G, '0', list[0])) or not(nx.has_path(G, '0', list[1])) or ... not(nx.has_path(G, '0', list[size-1])):
# execute instruction1