8 basic JavaScript concepts to know as a Beginner

Thread below https://abs.twimg.com/emoji/v2/... draggable="false" alt="🧵" title="Thread" aria-label="Emoji: Thread">
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">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
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">Variables

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

https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">String
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">Number
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">Boolean
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen"> Arrays
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen"> Objects
...
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">DOM manipulation

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

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

Study them.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">Conditionals

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

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

Learning this is crucial.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">Loops

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

It& #39;s a very important concept in JS that must be learned.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">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& #39;s identifier:

callFunction();
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">Scopes

In a JavaScript, some variables can be accessed by certain parts of the code while some can& #39;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.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔹" title="Kleine blaue Raute" aria-label="Emoji: Kleine blaue Raute">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:

https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen"> Callbacks
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen"> Promises
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen"> 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 https://abs.twimg.com/emoji/v2/... draggable="false" alt="👉" title="Rückhand Zeigefinger nach rechts" aria-label="Emoji: Rückhand Zeigefinger nach rechts"> @UbahTheBuilder for similar threads.
If you want an in-depth material to see all of these in action, you can get this eBook https://abs.twimg.com/emoji/v2/... draggable="false" alt="👇" title="Rückhand Zeigefinger nach unten" aria-label="Emoji: Rückhand Zeigefinger nach unten"> https://gumroad.com/a/834147443 ">https://gumroad.com/a/8341474...
You can follow @UbahTheBuilder.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: