5 JavaScript Concepts You HAVE TO KNOW

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there's so much to learn in javascript ah why yes new developer there is a lot to learn in javascript but in this video i'll break it down and tell you the five most important things you need to learn in javascript javascript is like any other language or framework or anything that you learn in life uh playing a sport playing an instrument whatever it is there obviously is a lot to learn there's a lot of practice that it takes there's a lot of just experience that it takes it's iterations and i talk about this in the boot camp that i teach you have to go through iterations you have to use stuff over and over again for it to really sink in uh so a lot of people maybe do html css and they get to javascript and a little overwhelmed and maybe you don't know exactly what you're supposed to know so i'm to break down the five most important things from my perspective of what you need to know in javascript and keep in mind by no means is this like an all-encompassing list of every single thing you need obviously because it's just five but this is not everything you need to learn in javascript these are the topics that i believe are most important for me so number one the first thing that i want to mention is equality and this is a specifically tricky thing in javascript because there is a double equals and a triple equals syntax now with the double equals it will compare values after it's done some automatic convert data conversion or data type conversion for example if i have a string with the number 32 inside of it and i check to see if it is double equals to the number 32 those things will actually be true because it's going to convert them to match each other's data type and then compare the value however a triple equals does not do that it just does a value comparison and does not do any conversions so that can be really tricky the other part of this that's really interesting and really important is the way that primitives are compared for equality versus objects primitives are looking just at the actual value of the thing a string a number so on and so on but objects are not looking at the values inside of the objects it's looking at that object in memory does this actually point to the same object in memory and if that stuff doesn't make any sense to you right now that's why this is number one on my list because it's very important in javascript knowing how the double versus triple equals works and then knowing how primitives versus objects and basically everything arrays and classes and all those are objects so understanding how those compare in terms of equality is really really important now number two on my list and i've done an entire video on this is asynchronous js how does javascript run and how do you interact with asynchronous javascript now this started with callbacks and there's still a lot of callbacks but you call a function and then as a parameter you pass a callback function that function is what will get called when that thing finishes doing its work i guess so the callback function uh was uh kind of the original way that we would do asynchronous javascript and then people started to look at it and they said hey this can get kind of ugly once you have callbacks inside of callbacks inside of callbacks and you have what's called callback hell so then they went to promises and that enabled the dot then and dot catch so a dot then would handle your successful response from a promise a dot catch would handle the errors coming back from a promise and then additionally they added on async await syntax to match things that are available in languages like c sharp so what this allows you to do is kind of wait for the actual data to come back in line in your code so you're not having to write a dot then catch which is my favorite syntax again if you want to learn more about the different ways that you can run asynchronous javascript check out that video but just know that everything or a lot of things that you'll do in javascript come from or are asynchronous so you need to understand how asynchronous stuff works when to handle a promise when to do async await all that kind of stuff to make sure that you really understand what is going on all right number three is error handling and this is maybe a little advanced for people that are that are new to javascript but i think this has several different implications and error handling could mean a lot of different things for example if you define a function that accepts a what you assume is a string in javascript there's nothing actually guaranteeing that someone's going to pass you a string they could pass you a number so then if you try to access the substring method on that thing on that parameter it's not going to work because it's actually a type of number so you have to prepare yourself for that you have to think about how can really how can people mess this up because there's really no structure in javascript which is the bright side and the downside sometimes but you have to kind of put yourself in that mindset of how can these things go wrong and if so how can i fix it so checking the types of your parameters checking that you actually have data there that they're not passing null and undefined or something like that another thing is getting into surrounding code that can throw errors with a try catch and this is really the crux of this is you have to be able to handle those errors because if you don't obviously it'll lead to problems especially if you're running like a node application and one of the more recent features or versions of node it will shut down your server completely if you don't handle the error so anything that can throw an error you need to be able to handle that using a try catch again also think about writing defensive code preparing yourself for things that can go wrong and handling them nicely yourself so that your application doesn't crash so error handling super super important has some different implications and a lot of it is just a mindset about how you think about the code that you write to make sure that you're protecting yourself against things that could go wrong all right next up is es6 syntax so es6 or es 2005 was a really big version of javascript there was lots of things that came in that new version of javascript and because of that that has really kind of been the limiter for me at least of kind of like a regular older javascript versus newer javascript and if you look at things like react for example or a lot of the tutorials that you'll see you're going to see a lot of es6 syntax inside of the javascript that you see or watch or read on a blog article and if you aren't familiar with that you can kind of become lost so here's a couple of key features from es6 syntax that i mean destructuring is a big big one so if you wanted to grab a property off an object you can do that right in line with a little code snippet and you can destructure multiple properties you can destructure from arrays this is used with the use state hook a lot in react for example so destructuring is really nice also the spread operator the spread operator allows you to take all of the items in an array for example and spread them out so you kind of get access to them individually it's useful for passing items in an array as parameters to a function so you can spread out the items in the array and pass them as individual parameters to a function it's useful for making copies of arrays and it's not just for arrays it's also for objects you can do the same exact idea but get out to the unique key value pairs and copy an object that sort of stuff a basic object so destructuring spread operator template literal strings these are so handy i almost i almost never use regular double quotes or single quotes i almost always use backticks that allow us to do variable interpolation or string interpolation with our data inside of that es6 template literal string so those are ones that i use all the time highly recommend you checking those out all right last up on this list is the array methods and i started a series on these because of how important they are map filter reduce sum every sort those functions are incredibly useful and it's stuff that you're going to see all over the place and to be honest some of the syntax with those are a little tricky especially when you see them the first time especially when combining them with arrow functions and the abbreviated arrow function syntax if you've never seen an error function if you don't know what an arrow function is array methods are a good way to get introduced to because people often use them what these arrow functions are so array methods are used all over the place i use them all over the place in my code that's why i thought it was worth putting that tutorial that playlist together to show how these different methods work so array methods are incredibly popular you will use them a lot you'll also see them used a lot so again a lot of my perspective is trying to get you prepared for what you're going to see and and thinking about how you can write code in a way that other people are going to be used to as well because you can do some some unique stuff and if no one else understands how to do it or if people do stuff that you don't understand how to do that's not very good so in this case these five things are gonna help you one become a better javascript developer to understand other people's javascript better three write better javascript yourself that other people are going to be uh really just kind of used to and prepared to handle so my top five things a quality async javascript era handling es6 syntax and array methods i am tinkering with the idea of doing like a hands-on hour to hour and a half javascript crash course on youtube to talk about all or a lot of these different things if you'd be interested in seeing uh that crash course let me know in the comments below and if you feel like there's any big topic in javascript that i missed in this video let me know that as well in the comments thanks for checking it out and i'll catch you next time
Info
Channel: James Q Quick
Views: 501,397
Rating: 4.9096379 out of 5
Keywords: must know javascript concepts, learn javascript, javascript basics, javascript fundamentals, javascript tutorial, become a web developer, web develompent, javascript equality, javascript array methods, es6 javascript, javascript error handling, async javascript, asynchronous programming, how to learn javascript, how to become a javascript developer, learn to code, javascript for beginners, how to code, intermediate javascript
Id: a00NRSFgHsY
Channel Id: undefined
Length: 9min 37sec (577 seconds)
Published: Tue Feb 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.