Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // Helper function that allows you run debugger on a function when it is passed
  2.  
  3. const runDebugger = func => {
  4. debugger;
  5. func();
  6. }
  7.  
  8. // Test case: Debugg a named function that has a forEach and Array
  9.  
  10. runDebugger(function logItems() {
  11. let arr = ['cinco', 'seis', 'siete'];
  12. arr.forEach(item => {
  13. return console.log(`This is my item: ${item}`);
  14. });
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement