Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
// Functions to execute
function greetPeople() {
  console.log("Hello People!");
}
function sayFirstname() {
  console.log("My First name is Roy");
}
function sayLastname() {
  console.log("My First name is Daniel");
}
// array of functions
const funcsArr = [greetPeople, sayFirstname, sayLastname];
// Loop through each array elements (functions references)
// and invoke the functions
for (let i = 0; i < funcsArr.length; i++) {
  // get the current function getting looped
  const func = funcsArr[i];
  // call the function
  func();
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers