Adding user input to a list

When adding the text from a user input field to a list, is it necessary to first assign the text to a variable, and then update the list using the variable name? Or is it okay to just update the list using the text directly from the input field? Specifically, in Lesson 4, the teacher example answer is:
onEvent(“addButton”, “click”, function( ) {
var addInput = getText(“reminderInput”);
appendItem(remindersList, addInput);

Would it be ok to use this instead:
onEvent(“addButton”, “click”, function( ) {
appendItem(remindersList, getText (“reminderInput”));

What would be the reason to assign the text to a variable first?

You do not need that extra variable unless it is unclear what you are adding to the list.

I would say in this case the teacher example doesn’t add anything with the variable, nor the name of the inputbox.

So either

// gets text from "reminderInput" and adds it to the remindersList
onEvent("addButton", "click", function( ) {
  var reminderText = getText("reminderInput");
  appendItem(remindersList, reminderText);
  updateScreen();
});

Which gives the variable a name that explains what it is or

// gets text from "reminderTextInputBox" and adds it to the remindersList
onEvent("addButton", "click", function( ) {
  appendItem(remindersList, getText("reminderTextInputBox"));
  updateScreen();
});

Name the input box in a way that tells us what it is. Even better still

onEvent("addButton", "click", moveInputTextToRemindersList);

function moveInputTextToRemindersList() {
  appendItem(remindersList, getText("reminderTextInputBox"));
  updateScreen();
}

Create a function that does what its name says and remove the comment.