javascript es6 drive a car 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");
}
}
}