If previous is undefined, set it to the defaultValue.