This time
Hi all, I'm back with another installment of these lists of lists. This time around I'm talking about JavaScript. So as always, I'm just some guy and by no means an expert please correct me in the comments if I'm talking out of the side of my you-know-what.
JavaScript
JavaScript is an amazing language. You can manipulate the DOM, build games, and make cool apps. There are many things you can do in this language but I'll highlight some of the things beginners need to learn and most of this will apply to other languages as well.
I said in a previous post to learn JavaScript after all the other things like HTML and CSS. But, if you really want to learn JavaScript, do so in isolation and that's how I would tell you to practice, at first. But if you're already familiar with HTML and CSS, go for it! I believe in you!
Things to learn
There's a lot to learn in any language and it can be confusing for your first so here are some personal favorite resources on learning JavaScript.
Topics to Study:
-
variables, how to define them
- let & const (don't use var, I mean it!!)
- variable scope (is the variable accessible)
-
data types
- number, string, boolean, symbol
- type conversion and testing, typeof
-
reference data types
- objects, arrays, etc.
-
operators
- addition, subtraction, division, multiplication, and more!! (+, -, /, *)
-
functions
- a reusable piece of code that is sometimes called a procedure if it doesn't return anything, but everyone just says function, unless they're being fancy or pedantic
-
control flow
-
loops
- for, while, for-in, for-of
-
conditional statements
- if, else if, else, [try, catch, finally] -> debugging
-
loops
- keyword this
- call, apply, and bind -> when/how to use them and where
arrow functions
-
DOM Manipulation
- create, remove, modifying an element
- adding CSS class to element to modify it
Resources
- Courses
-
Videos
Free Code CampTraversyMedia
-
Sites
-
Recommended Reading
If a book has a legally free version, I will link it. Otherwise, I'll link to its Google books page.
Next time I'll share some links on learning OOP or object-oriented programming in JS and how their classes work. There is a wealth of resources online and I can't hope to cover them all but I think these are pretty good and as always I'm open to any comments, critiques, or call outs.
Top comments (7)
Kevin,
Great post, but why do you feel using "var" is a non-starter? Since, I use it quite often. Is this a bad coding practice?
According to some JavaScript experts, yes. You shouldn't use
var
. Useconst
&/||let
.The reason for that,
var
isn't block-scopedvar
var
is a bad coding practiceMore in-depth article here:
Should You Truly Never Use var?
John Wolfe
I think Muhammad brings up some solid points here as to why you wouldn't want to use
var
. However, I don't agree with the author's notion thatvar
should never be used. In fact, I'd argue that usingvar
in the early stages of learning JavaScript will make the concept of declaring, changing, and working with variables easier to understand.Chris Ferdinandi, a vanilla JavaScipt expert, has a nice explanation on why he doesn't use
let
orconst
in his projects: gomakethings.com/why-i-dont-use-le...His reasoning:
let
andconst
aren't as backwards compatible asvar
, they can't be polyfilled, and trying to determing which type to use adds unnecessary cognitive overhead (especially for beginners).I totally agree with you. For a beginner, using
var
can be a good thing to understand working with variables.Thanks for that explanation. I never looked at it that way Muhammad. After reading the article I understand. I just have never had any problem with it. I do see the benefit with block-scoped and I do recognize the errors it gives using some linters. I will give it a try.
Glad I could help <3
Forcing myself to really learn JS so this article is great. I've worked in JS/jQuery for years but never fully understood them other than from working experience and by proxy. Mostly using the SoloLearn app on my phone to learn and finding opportunities at work to put it into practice.