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();