Weston Ludeke

Building a Quiz in JavaScript on Mexico’s capitals

Published (updated: ) in code.

image credit to @jorgeaguilar on Unsplash

I built a quiz in JavaScript to test users on the capitals of the 31 Mexican states. I built this project while learning two dimensional arrays as part of the Treehouse “Beginning JavaScript” course. You can click here to view the project live, via GitHub Pages.

A Treehouse Question Becomes a Full-Blown Project

The “Beginning JavaScript” course in Treehouse has a section on “Two-Dimensional Arrays“, which asked users to create a simple quiz with a two dimensional array (“Build a Quiz Challenge, Part 1“) and loop through the array as part of the quiz.

Instead of merely completing the assignment, I got a little excited and decided to take things a little (okay, a lot) further and turned the simple quiz I built into a full-blown web based quiz app in JavaScript, quizzing the user on the capitals of Mexico’s 31 states. I also cleaned up the HTML and CSS to give the quiz homepage a nice layout.

In addition to learning web development, I’m also learning Spanish and I’ve been working hard to learn more about Mexico and it’s history. I’ve been using Quizlet to study and learn the 31 Mexican states and it’s capitals, so it was fun building out essentially the same version of the quiz I’ve been using on Quizlet.

Click here to view the project live on GitHub Pages and click here to view the GitHub repo.