Crafty.extend()

public this Crafty.extend(Object obj)
obj

An object whose fields will be copied onto Crafty. This is a shallow copy.

Used to extend the Crafty namespace by passing in an object of properties and methods to add.

Example

Crafty.extend({
  isArray: function(arg){
    return Object.prototype.toString.call(arg) === '[object Array]'
  }
});

Crafty.isArray([4, 5, 6]);  // returns true
Crafty.isArray('hi');       // returns false