can.DefineMap.extend([name,] [static,] prototype)new can.DefineMap([props])map.each( callback(item, propName ) )
Extends can.DefineMap, or constructor functions derived from can.DefineMap, to create a new constructor function.
var Person = can.DefineMap.extend(
"Person",
{seal: true},
{
first: "string",
last: "string",
fullName: {
get: function(){
return this.first+" "+this.last;
}
}
})-
static
{Object}: Static properties that are set directly on the constructor function. -
prototype
{Object<String,can-define-map.propDefinition>}: A definition of the properties or methods on this type.
{can-define-map}: A DefineMap constructor function.
Creates a new instance of DefineMap or an extended DefineMap.
var person = new can.DefineMap({
first: "Justin",
last: "Meyer"
}){can-define-map}: An instance ofcan.DefineMapwith the properties from props.
each iterates through the Map, calling a function
for each property value and key.
{can.Map}: this Map, for chaining