self driving car js code example
Example: js self driving car
function selfDrivingCar (car){
while(car.isDriving){
console.log("vroom vroom");
if(car.isGoingToCrash){
car.dont();
console.log("crash avoided");
}
}
}
function selfDrivingCar (car){
while(car.isDriving){
console.log("vroom vroom");
if(car.isGoingToCrash){
car.dont();
console.log("crash avoided");
}
}
}