JavaScript is one of the most popular programming languages in the world, with a wide range of applications from browsers to servers, many companies looking to hire JavaScript developers, and many other advantages such as outstanding performance. That all makes it a great choice for starting to learn how to code. This tutorial series will help teach you the beginnings of the JavaScript programming language in Construct!
This tutorial is aimed at beginners. If you already know JavaScript, check out the Construct for JavaScript developers quick start guide.
JavaScript is not Java
One common point of confusion to clear up right away is that Java and JavaScript are two completely different programming languages! The naming is indeed somewhat confusing, but try not to get the two mixed up. For example if you search the web for help on JavaScript, be sure to specifically search for JavaScript and not Java, otherwise you will get results for the wrong programming language!
About this guide
This guide will help you learn the JavaScript programming language using Construct's JavaScript coding feature. This is a good way to get started as you can just start writing code right away without having to set up a development environment (such as a local HTTP server). The entire tutorial series is designed to work within the limits of the free edition, so you can learn JavaScript with this guide without having to purchase anything. Construct's JavaScript coding feature also provides lots of ways to do more in your projects, so is a useful thing for more advanced Construct users to learn as well.
Construct uses the standard JavaScript programming language so you're learning exactly the same thing as is used everywhere else in the industry. Construct does not alter the language in any way - in fact the browser runs your code directly.
Construct's block-based system in event sheets is designed to be easier for beginners to get started with. If you want to try getting started with blocks, or just gain some familiarity with Construct first, consider trying the Beginner's guide to Construct.
You don't have to have used Construct before to follow this guide. However some familiarity will be useful. If you are also familiar with variables, loops and functions in event sheets, this will also be helpful. These features of event sheets are intentionally designed to be similar to how the equivalent programming language features work. So if you know how they work in event sheets, this will help give you a head start in understanding how they work in JavaScript. This guide will note where event sheets have similar concepts to JavaScript. These references won't be essential to following the guide though, it's just extra context for Construct users who are already familiar with event sheets.
What you'll learn
This guide will cover the basic features of the JavaScript programming languages, covering topics like variables, 'if' statements, loops and functions. JavaScript is a mature language with a huge range of features, and this guide does not attempt to cover it in its entirety. The goal is to teach you enough JavaScript that you can learn from other guides across the web and know how to apply it in Construct. (Some additional guides will be linked at the end of the series.)
JavaScript was invented in 1995, and like most old programming languages, JavaScript has its fair share of quirks and legacy features. However this guide will focus on the most useful parts using a modern style with best practices, and avoid going in to detail about quirks or old features that are no longer widely used. In other words, this is a practical guide focused on writing real-world code.
Ready to get started? Head to the next page to write your first line of code!