items
simpleCart.extend( [target ,] , options )
arguments:
- target (optional): object that will be extended. If nothing is provided, simpleCart will be extended
- options: object of name/value pairs that will extend the targer
Extend simpleCart:
simpleCart.extend({
log: function( message ){
try{ console.log( "simpleCart(js) message: " + message ); }catch(e){};
}
});
simpleCart.log( "Hello" ); // "simpleCart(js) message: Hello"
Extend an object:
var object1 = {
first: "Bob" ,
last: "Jones"
},
object2 = {
middle: "Michael"
};
simpleCart.extend( object1, object2 );
console.log( object1 ); // { first: "Bob" , last: "Jones" , middle: "Michael" }
Comments
- There are no comments for this entry yet.