Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. var data = {
  2. "Something: true,
  3. "Something else": false,
  4. "Blah": false,
  5. "a fish ISA": true
  6. };
  7.  
  8. var thingFunctions = Object.keys(data).filter(function(e) {
  9. return typeof data[e] == 'function'
  10. });
  11.  
  12. var data = {
  13. "Something": true,
  14. "Something else": false,
  15. "Blah": false,
  16. "a fish ISA": true
  17. };
  18.  
  19. var thingFunctions = Object.keys( data ).filter(function( e ) {
  20. return (data[ e ] === true);
  21. });
  22.  
  23. console.log( thingFunctions );
  24.  
  25. // Will result in [ 'Something', 'a fish ISA' ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement