Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. function sayFullName(first, last) {
  2. console.log('hi ' + first + ' ' + last);
  3. }
  4.  
  5. function sayHi() {
  6. console.log('hi');
  7. }
  8.  
  9. function sayHiTo(name) {
  10. console.log('hi ' + name);
  11. }
  12.  
  13. function runWithDebugger(callback, optionalArray) {
  14. debugger;
  15. if (arguments.length > 1 && Array.isArray(optionalArray)) {
  16. callback.apply(this,optionalArray);
  17. } else if (arguments.length > 1 && !Array.isArray(optionalArray)) {
  18. console.log('The second argument must be an array.')
  19. } else {
  20. console.log(arguments.length);
  21. callback();
  22. }
  23. }
  24.  
  25. runWithDebugger(sayFullName, ['Roland','Deschain']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement