according to the stack overflow developer survey javascript is the number one most popular programming language in 2019 it's also not even close to the language it was five years ago almost everything has changed for the better from where it can run to the actual syntax of the language as we go into 2020 here's javascript explained in just five minutes when you load any page on the internet your computer sent a folder of files including at least one html file this html file is able to load javascript with something called a script tag from either the
same folder or elsewhere on the internet javascript is the only client-side language meaning it waits to execute code until it's on your computer using a program called the browser each browser has its own engine which is what actually executes the code among other things client-side code can change the display send data or fetch more data from the server you might have heard of client-side frameworks like react angular or vue which build on top of javascript and make writing client-side code a lot easier and more maintainable but that's another video traditionally javascript is an interpreted language
meaning the code is read line by line instead of having to go through a compile step where it's converted to machine code browsers have actually added something called the just in time compiler though to speed up their engines while javascript was known as a slow language in the past computers are so fast now that's hardly the case anymore javascript's doing pretty much everything these days from running servers to machine learning and more we can do a lot of stuff on the back end now with the javascript environment known as nodejs that means we can write
apis talk to databases and talk to other servers all with javascript node uses the same v8 engine as chrome so it's lightning fast still things that are very performance intensive are going to be better off with go or c plus let's talk about the language itself variables hold either single cell primitives or compound data primitives are usually numbers booleans or strings of text while compound data is held by arrays and objects in modern javascript we use the keywords let and const to declare variables if you plan to change it later use let otherwise use const
arrays also known as lists in other languages are just multi-celled ordered clusters of data objects also known as dictionaries in other languages are pretty much what they sound like you give it a word and it retrieves the definition for example if i give it the key name it'll retrieve the value aaron the dom or document object is the most important object in javascript it's a javascript representation of the structure of our html and is present in the variable document when we load the page the document object contains many element objects through the dom we can
search for specific elements add user event listeners or change how the page looks all this is possible through a set of methods called the browser api we'll get to methods soon javascript's a c like language meaning it stole most of its syntax from c this includes if statements for loops while loops and more speaking of loops most commonly will use a for in loop to iterate over an object and a for of loop to iterate over an array functions are just any code we want to use more than once we declare these with the special
keyword function followed by whatever we want to name our function and finally the parameters or inputs to our function you can think of them as variables that are set later when we use our function we'll also want to return something which will be the output or result of our function call a function with its name and by passing in inputs as arguments methods are the same as functions except they're attached to different data types we call these methods with the dot notation functions can also be written like this parameters are on the left and it
returns automatically if written on one line arrow functions are generally used in array methods which take a function as an argument and run that function on every item in the array don't worry that's as complicated as we'll get another huge part of javascript is known as asynchronous programming or performing non-deterministic operations such as a network request to a server to fetch more data we don't know when the request is going to return or if it's going to fail so we have to handle both of those cases async programming has evolved a lot over the years
in javascript but the current standard is async weight and it's awesome all you have to do is add the awake keyword and it will pause your program when you send a request until that request either comes back or fails while not technically javascript i also have to mention typescript which compiles into normal javascript vanilla javascript has what's known as dynamic types or no types and typescript gives us static typing meaning we have to be specific about what kind of value is in a variable this seems like extra work but it actually helps us catch a
ton of errors finally let's talk about npm the node package manager chances are if you need some code someone else has already written it you can download it as a module and chances are it's well tested and bug free anyway that's javascript in just five minutes please like the video if you liked it so other people can see it thanks for watching