Skip to content

Instantly share code, notes, and snippets.

@pixxelboy
Created September 16, 2011 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pixxelboy/1222022 to your computer and use it in GitHub Desktop.
Save pixxelboy/1222022 to your computer and use it in GitHub Desktop.
Exercise 1
// 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.
// Example call for functional version:
logCar({ color: 'blue', make: 'BMW' });
// Example call for OO version:
(new Car('Ferrari', 'red')).log();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment