Advertisement
KodingKid

Javascript Car Classes + Objects

Apr 11th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Cars {
  2.   constructor(car_name, model_year) {
  3.     this.name = name;
  4.     this.year = year;
  5.   }
  6. }
  7. let myCar = new Cars("FIAT", 2007);
  8. let yourCar = new Cars("Honda", 2000);
  9. let hisCar = new Cars("Volkswagen", 1996);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement