js var 以及 let 的差异

例子

window.checklist=[{"boardname":"motor_board","cur":"1.0.0","new":"1.0.1"},{"boardname":"power_board","cur":"1.0.0","new":"1.0.1"},{"boardname":"imu_board","cur":"1.0.0","new":"1.0.1"},{"boardname":"sensor_board","cur":"1.0.0","new":"1.0.1"}]

board_list={"imu_board":[,,,,,,,],"sensor_board":[,,,,,,,],"power_board":[,,,,,,,],"motor_board":[,,,,,,,]}

findsuccess=function(list){
for(i in list){
if(list[i]==){
return true
}
}
return false
}
for (let i = ;i < ;i++){
x=board_list[window.checklist[i].boardname]
console.log(x)
console.log(findsuccess(x))
}

例子

window.checklist=[{"boardname":"motor_board","cur":"1.0.0","new":"1.0.1"},{"boardname":"power_board","cur":"1.0.0","new":"1.0.1"},{"boardname":"imu_board","cur":"1.0.0","new":"1.0.1"},{"boardname":"sensor_board","cur":"1.0.0","new":"1.0.1"}]

board_list={"imu_board":[,,,,,,,],"sensor_board":[,,,,,,,],"power_board":[,,,,,,,],"motor_board":[,,,,,,,]}

findsuccess=function(list){
for(i in list){
if(list[i]==){
return true
}
}
return false
} for (var i = ; i < ; i++) {
x=board_list[window.checklist[i].boardname]
console.log(x)
console.log(findsuccess(x))
}
上一篇:扩展欧几里德算法


下一篇:关于开启.NET在线提升教育培训的通知! - 可在此页面观看在线直播!