Create a pull request for your final method presentation file to be submitted to the final repo.
When building applications or pages the problem will quickly arise where you will need to format part of your page's HTML in your JavaScript files
Templating libraries allow you to quickly create your own templates in your code and on-the-fly to render bulks of data quickly.
If you find yourself writing a few lines of JavaScript soley to form HTML blocks for your page, you might want to utilize a templating library.
A search will yield a handful -but a good place to start is either Underscore or Handlebars (Mustache).
Say we are researching police incidents caught on tape by body cams and are pulling together a dataset based on the information we find. It might look something like this (Note: This data is made up and should not be published! For example only)
You could write out in JSON initially but sometimes a program like Excel is better for pulling information together. Once you're finished, you can convert to JSON using an online program like Mr. Data Converter.
* Result *
We are going to go over Underscore, partly because it is a good library to know in general and because it has many useful methods for parsing data.
To use, download the library or find a hosted version to include on your page. For our purposes today we are using a version hosted by cdnjs.
Underscore has many very useful methods. We will use a few in our example, but make sure to look at the documentation for the full breadth of the library.
Using the files from template-practice as a base, let's write a small application that will run through your body cam data and display it on the page.
Do Codecademy's Game exercise to build a "Rock, Paper, Scissors" application to continue practicing writing JavaScript.