r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

45

u/Mydrax May 28 '19 edited May 28 '19
  1. The importance of using the Chrome DevTools.

  2. Why Linters make your life easier.

  3. Proper error handling (mostly writing code that doesn't fire errors).

  4. Being unable to fully understand or explain the 2 pillars of Javascript: Functional programming & Object Oriented Programming.

  5. How important it is to refer to the bloody documentation before hopping on stackoverflow.

  6. That not all tutorials, all books and all individuals relay accurate and most up-to-date information.

  7. bind(), call() and apply()

  8. High-order array functions like map() and specially reduce(). (It's very rare to see beginners use reduce() at all).

  9. The this keyword and I don't really know why but some beginners tend to find it difficult why you call super() inside the constructor of a child class.

  10. The Shadow DOM, it's not something you'd expect someone to know but it's ideal to learn about it after learning about the DOM and DOM manipulation.

  11. Promises, the for/of loop, async/await , callbacks etc. etc. or writing asynchronous code, and handling/catching errors properly.

  12. Destructuring and Spreading.

  13. Garbage Collection.

  14. Closures.

  15. That stackoverflow is the solution to all your problems.

I think that's a pretty constructive list of the common and more difficult things that beginners don't really know or can't understand. Some of them don't have to do anything with JS but hey!

19

u/snifty May 28 '19

Re 1), personally I think Firefox devtools are better.

1

u/jseego May 29 '19

I think so too, except that they are a hog

2

u/snifty May 29 '19

A memory hog?

1

u/Mydrax May 28 '19

Well, personal opinions. I haven't used the Firefox dev tools, plus Chrome is just used more often and has sick performance and memory profilers!

5

u/DerGernTod May 28 '19

firefox devtools got really fast too and they also have a memory profiler. however, recently i had a lot of issues with the firefox devtools (code continuing to run while being paused at a breakpoint, leading to variable hovers showing different values every time you hover them, breakpoints vanishing) and it's missing some features the chrome devtools have (event breakpoints, dom manipulation breakpoints etc.)

2

u/snifty May 28 '19

Fair enough. Both of those features are things I'm not terribly skilled at evaluating — a personal shortcoming, certainly — but for what it's worth I just checked Firefox and it has panels for both.

I have to be honest I find the Chrome dev tools kind of bewildering to look at, at least at first glance. It does seem to be better about error reporting though — the one time I do use it is if I’m not getting clear messages in FF, sometimes Chrome will help.

3

u/DerGernTod May 28 '19

Being unable to fully understand or explain the 2 pillars of Javascript: Functional programming & Object Oriented Programming. one more thing that probably fits into #4 of your list: the prototype chain

1

u/Mydrax May 28 '19

When you learn OOP in JS, you will indefinitely come across the prototype chain, won't you?

2

u/DerGernTod May 28 '19

true, but i think it's worth mentioning that OOP in JS is vastly different from OOP languages such as e.g. java. understanding the concept of the prototype chain is imo more important than learning the syntactic sugar keyword class and what it does (i agree a lot with kyle simpsons opinion on this, it's very misleading for people coming from different programming languages)

3

u/MoTTs_ May 28 '19

it's very misleading for people coming from different programming languages

Depends on which different language we're talking about. JavaScript's classes work surprisingly similar to Python's or Ruby's classes. JavaScript and Python classes side-by-side

2

u/simkessy May 28 '19

Garbage Collection?

2

u/FlandersFlannigan May 29 '19

Good list, but I don’t use bind, call or apply very often. Am I missing something?

0

u/[deleted] Jun 25 '19 edited Jun 25 '19

Agree with most but:

  1. Neither oop or fp are pillars of "the language".

  2. I don't really see how relevant it is to kniw the details of the shadow dom, especially as a beginner.

  3. Garbage collection...really?