Is there a simple way to use Underscorejs to achieve this? I have an object, having key and values.  I'd like to pick the object and call the appropriate function from the key:

var requireViews = {
            "breadCrumbView": true,
            "headerView": false,
            "footerView": false
        };

var that = this;

    _.each(requireViews, function(value, key){
                    if(value){ //if true?
                        if(_.functions(that, key)) that[key](); //checking is that function, and calling the function
                    }
                })


Is it ok or can we minimize it further?
To be honest, I'd skip underscore for this, and just do

for(var func in requireViews) {
  if(requireViews[func] &amp;&amp; typeof this[func] === 'function') {
    this[func]();
  }
}


Otherwise, there are many different ways to go about it.

Here's a needlessly complex one, for instance:

var target = this;
_.chain(requireViews)
  .keys()
  .filter(function (func) { return requireViews[func] })
  .intersection(_.functions(this))
  .each(function (func) { target[func]() });