Js repeat a function by for loop
JAHID
Posted on February 15, 2022
Syntex:
const hi = function () {
console.log('Hi! You Are Welcome !!');
};
function repeat(func, num) {
for (let i = 0; i < num; i++) {
func();
}
}
repeat(hi, 2);
💖 💪 🙅 🚩
JAHID
Posted on February 15, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
webdev A Tale of WeakMap and WeakSet in JavaScript: The Guardians of Forgotten Secrets
November 29, 2024