In the Question below out task are as follows:
- Delete the variables
content1Descriptionandcontent1Date - Add an object
newTaskwith the following variablescontentDescriptionmapped totaskInputcontentDatemapped todeadlineInputdoneinitialised asfalse
so the expected and correct code is:
const textInput = document.getElementById("taskInput");
const submitButton = document.getElementById("addButton");
const dateInput = document.getElementById("deadlineInput");
var newTask = {
contentDescription: textInput .value,
contentDate: dateInput .value,
done: false,
};
displayContents(newTask.contentDescription, newTask.contentDate);
However, submitting the above code the test will fail as the test expectes the incorrect code with the following errors
-
We have declared
textInputand nottaskInputthuscontentDescriptionshould expecttextInput.value. -
Same applied to the date field we have
dateInputand notdeadlineInput. -
displayContents()expects the user to pass 2 argscontentDescriptionandcontentDatethus expecting the user to passdisplayContents(newTask.contentDescription, newTask.contentDate, newTask.done);is incorrect unless we are expected to modify the function itself.
Question: