Pratham Profile picture
22 May, 22 tweets, 5 min read
Introduction to JavaScript β˜•

JavaScript is probably one of the most commonly used programming languages ​​nowadays. It has a wide range of applications in almost all technologies

πŸ§΅πŸ‘‡πŸ»
If you're planning to start with coding then JavaScript would not be a bad choice. In fact, it is the best choice. Why?

1. You can use it everywhere
2. A lot of jobs opportunities
3. Easy to learn
Lets talk about the use cases of JavaScript in bit detail

Web development is probably the largest field in IT industry. People all around the globe using web services in some context which makes this field even vast and eventually opens doors for beginners....
JavaScript gives you a job security. That's why every beginner can and should start their coding journey with JavaScript.
πŸ“Œ JavaScript is a single threaded language

In simple terms we can say that JavaScript executes code in order and must finish executing a piece code before moving onto the next one.

Does this make JavaScript a slow language? No πŸ‘‡πŸ»
Although JavaScript is a single threaded language but we have a concept called event loop.

Using a few smart data structures we can achieve the multi threaded functionality in JavaScript. Let's talk more about it πŸ‘‡πŸ»
πŸ“Œ Event loop

Call stack - It keeps all the operations in order which has to be executed. After successful execution, it is popped out.

Event Queue - It is responsible for sending new functions to the track for processing.
Event queue is a queue data structure which sends all the operation into call stack in order.

One key point to note here is that if an async function is called, it is sent to web API. For example setTimeout method.
Whenever setTimeout comes in stack, it is sent to web API which waits for the specified time to send this operation back to event queue.

Hence it is a cycle like this πŸ‘‡πŸ»
The another interesting part about is JavaScript is that you can start with it right away. Let me tell you how!?

You can run JavaScript on the client side and on the server side as well. Which means you can run JavaScript code right in your browser.
Follow this quick steps to get a taste of JavaScript

- Open your browser
- Right click anywhere
- Inspect
- A window will come
- From the top navigation bar, go to console

Here you can write JavaScript code
A typical roadmap of JavaScript. Starting with the basic topics

1. Print statement
2. Data types and variables
3. Basic operators
4. Logical operators
5. Comparisons
6. Loops and statements
7. alert()
8. prompt()
9. Arrays
10. Objects
11. Functions
12. Arrow function
13. Array methods
14. Hoisting
15. Closures
16. Callbacks
17. Promises
18. Async & Await
19. Currying
20. And other ES6 feature
Alright, although JavaScript has wide range of application but it is mostly used in web technologies. So let's talk a bit about JavaScript in terms of web development πŸ‘‡πŸ»
Start with JavaScript Variables

Variable are nothing but containers for storing data values. You will use them almost 100% in your JavaScript code.
There are three ways to declare a variable using var, let and const keyword
JavaScript is used to add some functionality in website. So that user can interact with the website. For that we have two basic methods:

An alert box is often used to popup some message whereas prompt is used for taking input from user
JavaScript - HTML DOM methods

You might know that JavaScript is for adding behaviour in your webpage. For that you need to catch the HTML element so that you can change things accordingly

HTML DOM methods are actions
HTML DOM properties are values that you can set
Using HTML DOM you can

- Catch element in JavaScript file
- Change whatever you want
- Add or delete element
πŸ“Œ Events

You can handle various events using JavaScript. An event can be defined as something the browser does, or something a user does.

For example, click is a event that user does, whereas onload is a event when user enters the page
An example of typical click event
The onclick attribute fires on a mouse click on the element.
You can check my handmade cheat sheets and notes of JavaScript in this thread

And I think that's pretty much it for this thread

I tried my best to give a quick overview of JavaScript. If you like this thread, drop a like and retweet, means a lot to me ❀️

Peace out πŸ˜‰

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Pratham

Pratham Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Prathkum

24 May
5 great Font websites for every web developer and designer πŸ†Ž

πŸ§΅πŸ‘‡ Image
1️⃣ Google Fonts

- Making the web more beautiful, fast, and open through great typography

πŸ–‡οΈ fonts.google.com Image
2️⃣ Font Space

- FontSpace is your home for designer-centered, legitimate, and clearly licensed free fonts

πŸ–‡οΈ fontspace.com Image
Read 6 tweets
23 May
Here is a curated list of threads in chronological order that can help you learn the entire CSS 🎨

πŸ§΅πŸ‘‡πŸ»
1. Kickstart your CSS journey with this thread. It will give you a quick overview ✏️

2. First and foremost, learn about box-model, it will cover height, width, margin, padding and border πŸ“«

Read 15 tweets
23 May
Web Layout πŸ–Ό

Structuring your website is essential as it provides better navigation and visualization of the content available on the site. Let's talk a little more about it and learn how we can create a proper layout

πŸ§΅πŸ‘‡πŸ» Image
Web layout aims for presenting imformation in a logical manner and to make the important elements stand out.

A well designed layout can catch more traffic on your website and make your content easy to understand
πŸ“Œ Design vs Layout?

Web layout is closely related to designing part. But we can say that web designing is much more than the layout only. It covers images, text, color scheme, typography and layout

On the other hand, Layout is all about arrangement of element on the webpage
Read 22 tweets
23 May
5 great icons websites for every web developer and designer ⏺️

πŸ§΅πŸ‘‡ Image
1️⃣ Icons 8

- Icons8 is just more than icons. You can download illustrations, vector images, music and much more

πŸ–‡οΈ icons8.com Image
2️⃣ Icon Monstr

- Black and white themed minimal icons which looks super great. You can also cuatomize the thickness

πŸ–‡οΈ iconmonstr.com Image
Read 6 tweets
23 May
We can create cartoons using CSS as well πŸ˜‰

Let's decode in this thread how we can create Ferb using few simple CSS steps. Let's go

πŸ§΅πŸ‘‡πŸ»
STEP 1: Create a Face of rectangular shape

- Create a rectangle and rotate it a little bit
- Give it a solid border without border-bottom
- Position it
STEP 2: Create Lips

- Make a small square
- Add bottom and left border
- Skew it so that it seems like a lip
- Add little bit of bottom-left radius to give it a more realistic look
Read 14 tweets
21 May
I have created countless number of Twitter headers using CSS

Here are my top 6 creations πŸ§΅πŸ‘‡πŸ»
1️⃣ A programmer desk

πŸ”— codepen.io/prathkum/pen/w…
2️⃣ Rocket producing fumes

πŸ”— codepen.io/prathkum/pen/V…
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(