Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.
oatkiller edited this page Sep 13, 2010 · 2 revisions

store is a function oatlib uses to store methods on global prototypes.

(function () {

	// create Number.prototype.double, but use namespacing, 
	// and store a take form of the same fn
	o.store(Number,'double',function () {
		return this * 2;
	});

	// take doesnt store the fn's at their name.
	// for example, double is:
	//	http://oatlab.com/oatlib/v2:::double
	// o.double's toString returns that qualified namespace
	
	(1)[o.double](); // 2;

	// o.double is the same fn, but in the take form
	// in other words the number isnt this, but the first param
	o.double(1); // 2
	
})();
Clone this wiki locally