items
simpleCart.Item.equals( item )
arguments:
- item: item to compare with
returns:
- true if items are the same (has all the same attributes except id)
- false, otherwise
var shirt = simpleCart.add({ name: "Shirt" , price: 4 }), mug = simpleCart.add({ name: "Mug" , price 2 }), shirt2 = simpleCart.add({ name: "Shirt" , price: 4 }); shirt.equals( mug ); // false shirt.equals( shirt2 ); // true
Comments
- There are no comments for this entry yet.