21-Day Challenge JavaScript Tutorial: Part 1 Par :Lighthouse Labs Education Team October 3, 2019 Estimated reading time: 1 minutes. So you've signed up for the 21-Day Coding Challenge, rounded up some teammates, and you're ready to get your JavaScript on and win some prizes. Just one problem: you don't know much about code. Short of plugging your brain into the Matrix interface and downloading JavaScript like Neo, how can you get ready for the 21-Day Coding Challenge? Call us Morpheus, because we've got your back. Here’s what you need to know: What is programming? Programming is a way to “instruct the computer to perform various tasks”. When we say “instruct the computer,” we mean that you provide the computer a set of instructions that are written in a language that the computer can understand. In the case of the 21 Day Coding Challenge, that language is JavaScript. What is JavaScript? JavaScript (“JS” for short) is a full-fledged dynamic programming language that, when applied to an HTML document, can provide dynamic interactivity on websites. While there is a LOT to know about JavaScript, this prep resource is designed to point you directly to the concepts you’ll need to know to solve the 21 days of coding challenges ahead. Getting Started Syntax Let’s start with the basics. Before learning to write in a spoken language, we must first learn the rules of grammar. In programming, these rules are known as syntax. Syntax is important for proper execution of our code, as well as for readability and maintainability for both ourselves and anyone collaborating on our code. To get started on your JavaScript journey, read more about its syntax here. The Console Once you’ve got the syntax down, we suggest getting acquainted with your new best friend, the console. The console is a display panel that often shows important messages about our code. We can reveal a lot about what our code is doing behind the scenes by logging things to the console. In the case of the 21 Day Coding Challenge, the console will show the expected output and any errors returned by our tests. If we want a particular piece of data or item to be printed to the console we can use console.log(). We can learn more about this built in action here. When we’re not sure why something isn’t working, it will be very useful to print values to the console, so we can see the work we’re doing. console.log("Print this value") Data Types in JavaScript Data types are used to classify one particular type of data in programming languages. For instance, a number and a string of characters are different types of data that will be treated differently by JavaScript. The data types we’ll be using in the 21DCC include: Strings Numbers Booleans Arrays Objects We can learn more about data types and how to use them here. Read part 2 of our prep series here.