var name = "mmt";
var myObject = {
name: "myObject",
property: this.name,
regularFunction: function() {
return this.name
},
arrowFunction: () => {
return this.name;
},
iife: (function() {
return this.name
})()
}
console.log('this.name: ' + this.name);
console.log('myObject.name: ' + myObject.name);
console.log('myObject.property: ' + myObject.property);
console.log('myObject.iife: '+ myObject.iife);
console.log(myObject.regularFunction());
const regFn = myObject.regularFunction;
console.log('regfn.call: ' + regFn.call(myObject))
console.log('regfn(): ' + regFn());
console.log('regFn.call(window): ' + regFn.call(window));
console.log('myObject.arrowFunction.call(myObject): ' + myObject.arrowFunction.call(myObject));
console.log('myObject.arrowFunction(): ' + myObject.arrowFunction())
console.log('myObject.arrowFunction.call(window) ' + myObject.arrowFunction.call(window)) Q. What will be the implementation of partialCurry function?
function mul(a, b, c){
return a * b * c;
}
const partialCurryMultiplied = partialCurry(mul, 2);
console.log(partialCurryMultiplied(3)(4) //should log 24 */Promise.all polyfill
Write a function to return the count of numbers in an array, if the array can consist of string, numbers and functions ? What will be the time complexity and space complexity ?
let myArr = [ 1,"2", [3,4,[5]], function(){}, 8, 9 ];