🧾

Invoice Creator

This document contains a hint for the Invoice Creator Solo Project.

PS: Please remember that we have both a #javascript-help channel and a #html-css-help channel in our Discord community. If you have a very specific issue you’re struggling with, you should consider posting it there.

JavaScript hints

  1. Use template literal strings to construct the HTML for the tasks list based on which services the user selects.
  2. Remember that when using onClick events, you have access to an event object which gives you a whole bunch of information about the HTML element you clicked on, such as the ID of data attributes of that element.
  3. An array is the perfect way to store data for this project. There are lots of array methods you can use to help you such as:
    1. Array.filter() looks at all the array items and places all the items that match a condition into a new array.
    2. Array.includes() looks at the entire array and returns a “true” if the value you want is inside the array.
    3. Array.push() Adds a new item to an array.
    4. Array.slice() Removes items from an array based on what index numbers you give.
    5. Array.indexOf() returns the index of whatever item you want in the array.
    6. If you’re not sure how to use any of these methods, google them and look for results by “MDN Web Docs”.

If you are still struggling for hours with this Solo Project after having used the above hints, please let the teacher Tom Chant know via the #general channel on Discord, and we will consider adding more hints. Important: be sure to include a link to your scrim, so that he can understand what you are struggling with.