Dictionary To Run Function

Getting a taste of the power of Functional Programming.

var lookup = 'johnnyCat'; 
var foo = {'johnnyCat': () => $('#questionAuthorship').slideDown('medium')};

// slide down the jQuery
foo[lookup]();

A similiar way of doing it is like this:

var katana = {
  isSharp: true,
  use: function(){
    this.isSharp = !this.isSharp;
  }
};
katana.use();