The map monoid implemented in javascript