You are now ready to add the horizontal menu and query for the categories list:
- Add the HTML in bold to index.html:
<div class="app-main"> <div> <ul id="menu"></ul> </div></div>
- Create a file named app.js, then implement a categories query and execute it when the app loads:
const templatesCache = {};function render(props) { return function(tok, i) { return (i % 2) ? props[tok] : tok; };}// a basic templating approach that uses regex for formatting specified props into the relevant placeholders in the templatefunction renderTemplate(templateName, props) { let template = templatesCache[templateName]; if (!template) { // reserve templates in cache for future quicker access template = $(`script[data-template="${templateName}"]`).text() ...