How to render an array of items in HTML & JavaScript

Feb 08, 2020

Technology

I recently rebuilt by personal website and decided to just use basic vanilla HTML, CSS and JavaScript and get out of dependency hell for a bit. I thought this would be a whole lot harder than it turned out to be. In fact, the most annoying part was probably having to write regular old CSS instead of using some preprocessor like SASS or LESS.

So when I wanted to render the projects on the page inside of a div, instead of doing like the following like in React using JSX:

React JSX

Vanilla Javascript

So as it turns out this was not so bad after all. It is a little bit more overhead having to write some more Javascript to get this to work. But this is what is happening in the background when you do it the React JSX way after all. So in smaller projects, why not just do it yourself?


  • Start
  • Blog
  • Uses
  • GitHub
  • Dev.to
  • Twitter