Priority list

Your task is to implement a form and display added items in the given order.

Requirements:

  • By default, the list should be empty.
  • Display items in the following order. First promo items, then sort by priority descending, then sort by name ascending. The provided example shows the correct order of items.
  • If the promo checkbox was checked, display * (separated by space).
  • Display the priority in parentheses.
  • Clicking on the add button should add a new item and clear the form. If the name or priority is empty or contains only whitespaces, do nothing.

You are free to add classes, styles, ids, but don't edit or remove data-test attributes.
Create an account to start coding
Create account