Dos and Donts: Best Practices When Learning JavaScript

preview_player
Показать описание
With every programming language, there's a list of best practices; do's and don'ts. JavaScript is no exception. Some of these best practices are there for your protection (like always always always using semi-colons!), some to make your code more readable and less error-prone, and some to increase the efficiency of your code.

Follow O'Reilly Media:
Рекомендации по теме
Комментарии
Автор

The narrator is sooo professional and then, at 8:23, with a barely detectable break in her demeanor:  "... something called Automatic Semi-Colon Insertion.  It sounds complicated and perhaps a little painful..."  I love that she did that :)  Very funny  

Tubeatorium
Автор

Here is a tip for people watching in 2020 or later: never use var, use const and let to declare variables. Also put the statement “use strict”; at the top of your code. This makes sure that your code is as modern as possible

meruzhansargsyan
Автор

Some of these are applicable not only to JS, but to any programming language.

victornaut
Автор

Some really nice tips. Thanks for the teaser.

NoahNobody
Автор

Impressed by this insightful video. I'm subscribing now!

IsaacAsante
Автор

write code for humans not computers. Don't Repeat Yourself. Keep it Simple.

jessupboyus
Автор

great video  o'reilly , its better then other videos i saw  :)

bustnoutloadedcaliber
Автор

I think that there is an error in that first example of choosing good variable names.
This will cast all values of the object as 0
Should the line theArray[i] = 0 not be
theArray[i] = obj[key];

StewartLynch
Автор

Shouldn't message be set to div.innerHTML instead of empty string? What if we supposed to process more than one array?

tolich
Автор

Useful intro and appreciate the clear voice, but drop the silly stock pictures. "You can't have two variable names with the same names." might want to word that better.

ReinardDolleschel
Автор

I went through everything on JavaScript at 3wschools, I can use all of them individually but still can't build any meaningful app. I can change contents on DOM, change styles, change image SRC but that is where it ends. where can I learn advance stuffs, like building a real life app

odunladeoluwaseun
Автор

Best practices for JavaScript: use let and const instead of var if you can.

dayvie
Автор

What consoles should I download to practise on my PC?

chubbyBunny
Автор

I tried this and does not work inside my body:

 <script>
      function arrayFromObject (obj) {
     var theArray = [];
 var i = 0;
 for (var key in obj) {
    theArray[i] = 0;
i++;
 }
 return theArray;
  }
  </script>

practicerepeat
Автор

This is excellent marketing, might I say!

x
Автор

Most of these aren't exclusive to Javascript, and this video could definitely have been reduced to a 5 second list. Also, the intro was kinda' creepy (not much offense intended).

glialcell
join shbcf.ru