Absolutely, it will be the best programming decision you’ve ever made. It’s used everywhere.
Programming languages are how humans tell computers what they want them to do. They are an expression of logic, business rules and instructions, written in a fixed way that the computer can understand. We call this syntax.
Open up the JS Console editor and type in
When you press enter, you should find a popup saying ‘Hello World’. Congratulations, you’ve run your first computer program!
Note – if this doesn’t work for you, make sure you type the code in exactly as written. Accuracy is key! Computers aren’t forgiving when it comes to interpreting instructions.
Let’s break down what’s happening.
After the word alert we have some brackets. All functions have brackets (sometimes called parentheses) which contain any inputs the function needs to run. Think of our recipe mentioned earlier, we might want to give our recipe an input of how many people to make a cake for. Our function might look like this:
This would imply a function that makes a cake for 5 people.