× Check out these great resources! w3schools MDN Docs CSS Tricks
☰ Learn More Here

Javascript Basics

So you want to learn to code?

If you happen to be reading this I'm going to assume you're interesting in learning about how to use Javascript. The first thing you should know is that there's a lot to know. Seriously, it's astounding how many different things you can do with Javascript. Today I'll share with you just a few of the basic things you'll need to understand should you endeavor to expand your coding knowledge!

Objectively objects

So, starting off lets talk about objects! Pretty much everything in JavaScript can be considered objects. In fact both of the other two things I'll tell you about after objects are, well, objects. Objects are sort of like boxes that you can store your stuff in. The "stuff" you put in the box can help determine its value or keep important info organized. For the mathmatically inclined you could think of objects as variables. For instance, if I were to say that "x = 10", x is our varible and 10 is our value. Both x and 10 are objects as well. In another case if I said that, Pirates = "Smelly", I'd be stating that my variable, Pirates, are smelly. Pirates and "Smelly" are both objects!

Putting the Arr in Array

In this section we shall discuss something called an Array. As mentioned in the previous section an array is an object. Arrays are special in the sense that they can hold multiple values of all different kinds, all at once. To better help you understand how an array works I'll walk you through making one. So, if we were to say: let pirate = ["Peg Leg", "Parley", 1]. Simple right? Making an array is a cake walk, utilizing the information inside of it is more of a plank walk though. In the next section we can cover that!

Funct it up

The final nugget of knowledge I'll teach you about today is regarding Functions! So a function allows you to tell your script what to do, how, and when. There are all kinds of different functions that can all be used for different situations. Today we can just get our feet wet and look at what a basic function looks like and what it will do. For this we can say: let Ahoy = function matey(){console.log("Pirate greeting!")} So now Ahoy represents the function matey(). If we were to 'invoke' or call the function we would get the reply 'Pirate greeting!'. There are lots of complex things you can do with a function and if you're eager to learn more you can check out the links in the "Learn More Here" menu in the top left corner!