I'm working with Leaflet.js & Leaflet-Editable.js there are a lot places where I need to respond to clicks on, creation of, etc. different types of map features differently. This function allows me to eschew if,else,if,else blocks for these cases.
Example:
if(is(L.Marker, feature)){
setMarkerStyleActive(feature);
} else if(is(L.Polyline, feature)){
setPolylineStyleActive(feature);