const module = { x: 42, getX: function() { return this.x; } }; //when we are assigning a new var to the function’s method const unboundGetX = module.getX; console.log(unboundGetX()); // The function gets invoked at the global scope // expected output: undefined
3. Funksiya yarating
Funksiya obyektlarni arrayda qabul qilsin. Va ikkinchi parameter uchun son qabul qiladi.
Obyekt ichidagi inson yoshlarini parameterga berganimizda ushanchaga qushib quysin.
agePerson([ {bill:24}, {Mr:25}], 3) // [ {bill:27}, {Mr:28}]