Pull to refresh
5
0
Подгорный Дмитрий @zimorodok

User

Send message

Извлечение ссылки на объект из замыкания

Reading time2 min
Views1.7K
var  singleton = (function () {
	var data, method_args;

	data = [];
	method_args = [];

	function add (items) {
		var i;

		data.push(items);
		method_args.push(arguments);
	}

	function remove () {
		data.pop();
		method_args.push(arguments);
	}

	return {
		add : add,
		remove : remove
	}
}());

Есть доступ к объекту singleton.
Про то как получить ссылку на data
Total votes 22: ↑13 and ↓9+4
Comments19

Information

Rating
Does not participate
Location
Украина
Registered
Activity