// Exercise 1 - OO || !OO // Define a data structure for cars (make and color), and a function // that logs a string like "I'm a red Mercedes" to the console. // Make two versions: a functional version, and a object-oriented version. function logCar(car) { console.log(["I'm a", car.color, car.make].join(' ')); } function Car(make, color) { this.make = make; this.color = color; this.log = function() { console.log(["I'm a", this.color, this.make].join(' ')); }; }; // Example call for functional version: logCar({ color: 'blue', make: 'BMW' }); // Example call for OO version: (new Car('Ferrari', 'red')).log();