Object mapping for Javascript