curried indexing of javascript objects