Guest User

Untitled

a guest
Dec 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function squareNum(x) { return x*x }
  2.  
  3. function functionLogger(func, num){
  4. console.log("Function Starting");
  5. var result = func(num);
  6. console.log("Function Complete");
  7. return result;
  8. }
  9.  
  10. var squareOfFour = functionLogger(squareNum, 4);
  11. // Function starting
  12. // Function complete
  13.  
  14. console.log(squareOfFour); // 16
Add Comment
Please, Sign In to add comment