Fix invalid if/else JavaScript example