Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. var os = require("os");
  2.  
  3. var os_func_list = Object.keys(os);
  4.  
  5. os_func_list.forEach(function(element) {
  6.  
  7. // I know this is not working
  8. // var func = "os." + element + "()";
  9. // console.log(func);
  10. }, this);
  11.  
  12. var os = require("os");
  13.  
  14. var os_func_list = Object.keys(os);
  15.  
  16. os_func_list.forEach(function(element) {
  17. var func = os[element];
  18. func()
  19. });
  20.  
  21. os_func_list.forEach(function(element) {
  22. os[element](/*...args here if desired...*/);
  23. }, this);
  24.  
  25. os_func_list.forEach(function(element) {
  26. os[element].call(/*...this argument here...*/, /*...args here if desired...*/);
  27. }, this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement