Functional inheritance is the process of inheriting features by applying an augmenting function to an object instance. The function supplies a closure scope which you can use to keep some data private. The augmenting function uses dynamic object extension to extend the object instance with new properties and methods.

Functional mixins are composable factory functions that add properties and behaviors to objects like stations in an assembly line.

// Base object constructor function
function Animal(data) {
  var that = {}; // Create an empty object =; // Add it a "name" property
  return that; // Return the object

// Create achild object, inheriting from the base Animal
function Cat(data) {
  // Create the Animal object
  var that = Animal(data);
  // Extend base object
  that.sayHello = function() {
    return 'Hello, I\'m ' +;
  return that;

// Usage
var myCat = Cat({ name: 'Rufi' });
// Output: "Hello, I'm Rufi"