(function (global) {
	var mapArray;

	if (!global.UAM) {
		global.UAM = {};
	}

	mapArray = function (array, callback, ctx) {

	};

	global.UAM.mapArray = mapArray;

}(window));

/*

Przykład użycia:

var arr = [1, 2, 3, 4, 5, 6];

var newArray = mapArray(arr, function (arrElement, index, array) {
	return arrElement + 2;
});

newArray; // [3, 4, 5, 6, 7, 8]

var values = {
	multiplyBy: 10;
};

var newArray2 = mapArray(arr, function (arrElement, index, array) {
	return arrElement * this.mutiplyBy;
}, values);

newArray2; [10, 20, 30, 40, 50, 60]
*/

@@ -119,16 +119,180 @@
  ctx) %7B%0A
+        if (ctx === undefined) %7B%0A            self = this;%0A        %7D else %7B%0A            self = ctx;%0A        %7D%0A        return array.map(callback.bind(self));%0A        
 %0A%09%7D;%0A%0A%09g

Add exercise2 form Lesson2