created a few abstractions to illustrate fine points on javascript functions