JavaScript, Code Quality.
the update logic in single function and call the function with required value. this way your overwrite will not affect other logic also when modify the code you no need to check 100 place to confirm all the things are ok. Keep it short whether its code file or individual function keep the things