I think this variable should actually be `var isEnabled = this.getAlarms()[idx].enabled;` - the only places that needs the `alarm` reference are to check if it's `enabled` or not.