Answer the question
In order to leave comments, you need to log in
How to use a function from an array?
Such a question is how to make it so that you can use a function from an array, for example
let pit = function (e) {
for (let i = 0; i < e.length; i++) {
console.log(e[i]);
};
};
let arr = ['Sergey', 'Dasha', 'Valera', 'Grigorii', pit];
let fun = arr[4];
arr[4](document.getElementsByClassName("btn")[0]);
так ? или может
fun(document.getElementsByClassName("btn")[0]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question