The following exercise should help you to try out modules and some other advanced ES6 techniques. We have a simple website, which shows cards of sorting algorithm. The cards contain a title, small description, time and space complexity and the execution time for sorting of X elements. Also try to improve the code by using already known javascript techniques and functions.
- Write a function which generates a card template, fill it with data and return the complete HTML markup, so it will be rendered then to the body.
- Write a function which measures the performance of each sorting algorithm when you click on a button
card_generator.js
,data.js
andsorting_algorithm.js
should be used as modules- the sorting algorithm and the data will be provided in the javascript files
- modules
- ES6 features like
- destructuring objects
- spread parameter
- and more.
- try to avoid
jquery
and usevanilla javascript
instead
- https://dev.to/alexmercedcoder/introduction-to-sorting-algorithms-in-javascript-b60
- https://www.w3schools.com/react/react_es6_destructuring.asp
- https://www.w3schools.com/react/react_es6_modules.asp