Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function repeat (fn, n) {
- for (i=0; i<n ; i++){
- //calling arbitrary function
- fn();
- }
- }
- var helloVar = function hello(){
- console.log('Hello World');
- }
- var goodByeVar = function goodBye(){
- console.log('Goodbye World');
- }
- repeat(helloVar , 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement