8 basic JavaScript concepts to know as a Beginner

Thread below 🧵
🔹Events

JS is an event-driven language. There is an action/event from the user to trigger your script to run.

You define an event handler that will run when a particular event eg click, hover etc is triggered.

There are many DOM Event methods and Properties to learn
🔹Variables

Variables are containers of data. It's important to learn about identifiers like let, const and var. Also understand the different data types:

✅String
✅Number
✅Boolean
✅ Arrays
✅ Objects
...
🔹DOM manipulation

This is Document Object Model. It's a tree-like representation of our HTML page. JavaScript provides us some methods to manipulate the DOM:

- querySelectorAll()
- createElement
- getAttribute()
- getElementByTagname()
...

Study them.
🔹Conditionals

This is the foundation on which algorithms and logics are written.

If (thisThreadGood) {
retweet ()
}
else ...

Learning this is crucial.
🔹Loops

Sometimes, you'd want an instruction to continuously execute until a condition is met. This is called looping or iteration.

It's a very important concept in JS that must be learned.
🔹Functions

Functions are pieces of code you can call to perform an action/task. It can take data in as parameters. After defining a function, you can call it by using it's identifier:

callFunction();
🔹Scopes

In a JavaScript, some variables can be accessed by certain parts of the code while some can't. These depends mainly on the type of identifiers used to define variable. It can make the variable block or lexical scoped.

This concept is known as scoping.
🔹Asynchrony

JavaScript is Async in nature. This means that you can "tell" part of the code to run "later" or "wait" while others run immediately. This covers:

✅ Callbacks
✅ Promises
✅ Generators
...
There are tons of other concepts to know but I choose to shed light on these.

You can put the ones I omitted in the comments.

If you found this helpful, follow me 👉 @UbahTheBuilder for similar threads.
You can follow @UbahTheBuilder.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: