From React-Module-Project created by SallyMcGrath: CodeYourFuture#25
Instructions:
Add an onClick handler to the columns of the result table, which sorts the results ascending (A -> Z). Clicking the column again will reverse the sort order to descending (Z -> A).
Hint: Try using the .sort() method with a callback to do custom sorting.
Test:
From React-Module-Project created by SallyMcGrath: CodeYourFuture#25
Instructions:
Add an
onClickhandler to the columns of the result table, which sorts the results ascending (A -> Z). Clicking the column again will reverse the sort order to descending (Z -> A).Hint: Try using the
.sort()method with a callback to do custom sorting.Test: