-
Notifications
You must be signed in to change notification settings - Fork 27
CoreExtended
DanilaMihailov edited this page Jun 29, 2012
·
1 revision
Extend object with from properties.
config = atom.core.extend({
// default values for config
a : 15,
b : 20
}, config);
atom.core.extend({
value: 123
});
alert(atom.value); // 123
Extend object.prototype with from properties.
atom.core.implement(child, parent);
atom.core.implement({
test: function () {
alert(123);
}
});
var a = atom();
a.test(); // 123
Returns clone of object
var cloneArray = atom.core.clone(oldArray);
Returns type of object:
atom.core.typeOf( document.body ) == 'element'
atom.core.typeOf( function(){} ) == 'function'
atom.core.typeOf( new Date() ) == 'date'
atom.core.typeOf( null ) == 'null'
atom.core.typeOf( arguments ) == 'arguments'
atom.core.typeOf( /abc/i ) == 'regexp'
atom.core.typeOf( [] ) == 'array'
atom.core.typeOf( {} ) == 'object'
atom.core.typeOf( 15 ) == 'number'
atom.core.typeOf( true ) == 'boolean'
var MyClass = atom.Class({});
atom.core.typeOf( new MyClass() ) == 'class'
source here.