From the course: JavaScript for Web Designers

Jargon - JavaScript Tutorial

From the course: JavaScript for Web Designers

Start my 1-month free trial

Jargon

- As with any piece of technology, JavaScript has a lot of jargon. We're not going to cover nearly all the jargon, you'd need to become an expert in JavaScript in this course. But, I do want to give you an overview, of a lot of the basics that you'll need, to make some sense of what we're doing here. We'll start out with data types. JavaScript is aware of a lot of different types of data, you have numbers 123, all that sort of thing. Everybody knows what a number is. You have strings, which are a sequence of words or characters. There are Booleans, which refer to something which is either true or false. And then we have Data types, that are collections of data, Objects are the big ones in JavaScript, we have some built in objects like window, which is called the Global object, when you're working in a browser. basically, everything that's defined in JavaScript when you're working in a browser, is somehow part of the global window object. Then we also have Document, which is how you Interface with the Document Object Model, which is something we'll be talking about a little bit later, and, a whole bunch more others. Objects more generally, the ones that you can create yourself, and the ones that are built in, are said to have properties which are just pairs of keys or names and their values. Then we also have arrays, which are a type of data you see in a lot of different programming languages. in JavaScript, they're basically objects under the hood treated a little different. You can still think of them like we do in other languages though. They're basically a sequentially ordered list of items. And those items can be any of the other data types. JavaScript has variables. You may remember variables from a math class in your past, but JavaScript uses them as well. If we think of JavaScript as a language, like a spoken language, then you can think of variables kind of like the nouns. They're sort of like proper nouns. You take something, be it a number, or a sentence or whatever. And you give it a name. That name is the variable. There are also operators, which if we're keeping in the metaphor that we're going with of JavaScript as a spoken language, or like verbs. These are how you can take things and make changes to them. JavaScript has a whole bunch of these, and they can be all kinds of symbols, a few of them are plus, equals double equals, exclamation point equals, and there are quite a few others. There's plus which can be used for addition, or for concatenating, two strings together, that means combining them together. There's the equal sign, which is used to assign data to a variable. And then there's the double equal sign and exclamation point equals, which are used for doing logical tests to say this is equal to this, or this is not equal to that other thing. Now, we'll move on to functions. If we're stretching this linguistic metaphor to its absolute breaking point, you could sort of think of functions as JavaScripts paragraphs. They're also a datatype in their own right, but they're a way to combine statements into single blocks that you can reuse. If a function is inside an object. It's called the method. Arguments is another piece of jargon in JavaScript, and indeed, in most programming languages, they're also called parameters. In this case, and argument is how we get data into a function for further processing. It's really it. Most often, you'll see that as named arguments, which means that there are variables that are defined only in the context of that function, which we can then process. Another piece of jargon is control structures. These are how we do logical operations. That is to say, if we want to do something in some cases, but maybe not others, or we want to do something a certain number of times, anything like that is called a control structure. So, when we're talking about logical control structures, we have if ,else, switch, things like that, if and else are usually used together, and then a switch statement is just another way of phrasing the same thing. Basically, it all means if certain conditions apply, do this, if other conditions apply, do that instead. And finally, if this other condition applies, do yet another thing. Then we also have the notion of loops. There are a couple of main types of loops you'll use in JavaScript. One is the for loop, which you'll see a lot. And then the while loop. I'm not going to go into too much detail on those right now. But, just know that they're both ways to do something over and over again until you need to stop. So, that's a look at some of the jargon that you're going to be exposed to in this course. If you're interested in learning more about JavaScript or you just feel like you could use some more detail on any of these sort of jargony topics, you can check out my course, Learning the JavaScript language.

Contents