JS Basic | kottans

foo.x ???

What would be the constructor of kottans in the example below?

What is the final value of array below?

function copyArray (array, needto) {
	let output =[];
    for(let i = 0; i < array.length; i++){
    	output.push(needto(array[i]));
       }
  return output;
}

const mult(input){return input * 2};

const result = copyArray([1,2,3], mult)
function copyArray (array, needto) {
	let output =[];
    for(let i = 0; i < array.length; i++){
    	output.push(needto(array[i]));
       }
  return output;
}

const mult(input){return input * 2};

const result = copyArray([1,2,3], mult)
function outer () {
	let counter =0;
	function increase () {
    counter ++
    }
    return increase;
}

const callfun = outer();
callfun();
callfun();
function outer () {
	let counter =0;
	function increase () {
    counter ++
    }
    return increase;
}

const callfun = outer();
callfun();
callfun();
function outer () {
	let counter =0;
	function increase () {
    counter ++
    }
    return increase;
}

const callfun = outer();
callfun();
callfun();
function outer () {
	let counter =0;
	function increase () {
    counter ++
    }
    return increase;
}

const callfun = outer();
callfun();
callfun();
function outer () {
	let counter =0;
	function increase () {
    counter ++
    }
    return increase;
}

const callfun = outer();
callfun();
callfun();

What happens inside JavaScript Engine ?

Difference between Object.freeze() vs const

Difference between

ES6 Map and WeakMap

Implement such function

Made with Slides.com