Incorrect Test parameters

In the Question below out task are as follows:

  • Delete the variables content1Description and content1Date
  • Add an object newTask with the following variables
    • contentDescription mapped to taskInput
    • contentDate mapped to deadlineInput
    • done initialised as false

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

  1. We have declared textInput and not taskInput thus contentDescription should expect textInput.value.

  2. Same applied to the date field we have dateInput and not deadlineInput.

  3. displayContents() expects the user to pass 2 args contentDescription and contentDate thus expecting the user to pass displayContents(newTask.contentDescription, newTask.contentDate, newTask.done); is incorrect unless we are expected to modify the function itself.

Question:

Your code is perfectly correct. Actually JavaScript is quite forgiving. I appreciate your efforts, keep up the great work!

1 Like