7️⃣ Unique Features of JavaScript 🔥

Are you new to JavaScript? Know about these 7 features that are rare in other programming languages.

🧵 👇
1️⃣ undefined
2️⃣ Functions as first-class citizens
3️⃣ Closure
4️⃣ Prototypal Inheritance
5️⃣ Divide by Zero doesn't result into error
6️⃣ Array-Like
7️⃣ Strings are primitives
1️⃣ undefined

✪ Almost all languages have a special empty value which is called null, Null, None etc

✪ In addition to null, JavaScript also has one more: undefined

✪ If something is not known to exist, use "undefined". If something exists but its value is unknown, use "null"
2️⃣ Functions as first-class citizens

In JavaScript,

✪ Functions can be treated as values, i.e. can be stored as a value in a variable

✪ Functions can be passed as arguments to another function

✪ Functions can be returned from another function

Hence, first-class citizen.
3️⃣ Closure

✪ Variables can have scopes to be accessed inside a function only.

✪ Because functions are first-class citizens, an inner function can be defined inside any function.

✪ The inner function can access variables scoped to parent function which is known as "Closure"
4️⃣ Prototypal Inheritance

✪ All JavaScript objects inherit properties and methods from a prototype

✪ Prototype itself is an object which may inherit from another prototype

✪ When we read a property from object, and it's missing; it automatically takes it from the prototype
5️⃣ Divide by Zero doesn't result into error

✪ Many languages throw error when a number is attempted to be divided by Zero.

✪ But, JavaScript handles it other way. It results into NaN, Infinity or, -Infinity.

✪ Example

0 / 0 ⇨ NaN
1 / 0 ⇨ Infinity
-1/0 ⇨ -Infinity
6️⃣ Array-Like

✪ If an object has a "length" property and can be iterated, that's known as "Array-Like".

✪ If an object is "Array-Like", it can be used like an Array in many use cases.

✪ Example: strings are "Array-Like".
7️⃣ Strings are primitives

✪ Unlike many other languages, JavaScript treats strings as primitives. Where needed strings are auto converted to objects.

✪ Though there are ways to create Strings as Objects, but it's unnecessary and not recommended.
With this, we come to the end of this 🧵. Did you find it useful?

You can help in making this content reaches many
♥️ Like
🔁 RETWEET
💬 Reply
the very FIRST tweet in this 🧵

To never miss any content from me,
✅ Follow @swapnakpanda
🔔 Turn on Notifications

• • •

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

Keep Current with Swapna Kumar Panda ✨

Swapna Kumar Panda ✨ 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 @swapnakpanda

22 Dec
🏙 Why should you use Semantic HTML?

✘ <div> ➜ <header> ✓
✘ <div> ➜ <nav> ✓
✘ <div> ➜ <section> ✓
✘ <div> ➜ <article> ✓
✘ <div> ➜ <aside> ✓
✘ <div> ➜ <main> ✓
✘ <div> ➜ <summary> ✓
✘ <div> ➜ <footer> ✓

But why?

➊ Improve site's SEO positioning
➋ Help your site accessible
➌ Closer to natural language, easier to maintain
➊ Improve site's SEO positioning

❏ Search Engines may analyse the code for our website.

❐ They may use markups, labels to better understand the purpose of our web page.

❏ Using Semantic tags helps in this purpose.
Read 6 tweets
21 Dec
💙 Custom React-Based Tools

⮑ Web App
⮑ create-react-app
⮑ Gatsby
⮑ Next.js
⮑ Native App
⮑ React Native Mobile
⮑ React Native Desktop
⮑ CLI
⮑ Ink
⮑ React Blessed
⮑ PDF
⮑ react-pdf

And, many more.

🧵 👇
❝Learn React Once
Build Apps for any Platform❞

❍ React's architecture is so flexible that anyone can build a custom renderer

❍ The renderer converts JSX component to native component

❍ The final product could be anything. It even doesn't need JS-Engine at run-time.
⬔ Web Application

⮑ Client-Side
⮑ create-react-app (SPA)
⮑ Server-Side
⮑ Gatsby (SSG)
⮑ Next.js (SSR + SSG)

❅ Legend:

➊ SPA: Single Page Application
➋ SSR: Server Side Rendering
➌ SSG: Static Site Generator
Read 10 tweets
20 Dec
🔥 🔥 JavaScript Frameworks to build API & Microservices

⭔ Hapi
⬠ Express
⭔ Next.js
⬠ NestJS
⭔ Loopback 4
⬠ Restify
⭔ Feathers
⬠ Moleculer
⭔ Sails
⬠ Actionhero
⭔ AdonisJS
⬠ Koa
⭔ Fastify

Which one is your favourite? Reply in 💬
Before proceeding, if you want to find out different ways of calling APIs in JavaScript, check 👇

⭔ Hapi

❍ Hapi is a simple, secure, and open-source javascript framework.

❍ It is used to build powerful, scalable applications with minimal overhead.

❍ It was originally developed to handle Walmart’s Black Friday sale.

➢ Refer: hapi.dev
Read 16 tweets
19 Dec
8️⃣ ways of making API calls in JavaScript 🔥

⮑ Browser [Client-Side
⮑ Fetch API
⮑ axios
⮑ jQuery
⮑ XMLHttpRequest

⮑ Node.js [Server-Side
⮑ https
⮑ axios
⮑ node-fetch
⮑ got
⮑ superagent

Which one do you use? Reply in 💬
❍ There are 2 parts to an API. A server and, a client.

❍ A client makes an API call by requesting an API server to consume some API data.

❍ There exists many in-build/external libraries which help in making those API calls.

Let's explore them 👀
➊ XMLHttpRequest

❍ XMLHttpRequest is a built-in browser object that allows to make HTTP requests in JavaScript.

❍ It was deprecated in ES6 with the introduction of Fetch API. Still it is used to work with old browsers.

❍ The response is always in String format.
Read 11 tweets
19 Dec
A successful product relies on 2 things

🛣 user friendly features (business requirement)
🔭 future-ready system (system design)

Of course Marketing, Usability are important as well.

A small discussion, 🧵 👇
{1/4}

While building a house, you plan it for at least 2 decades.

But, while building a product, what's in your mind?
{2/4}

Business requirements should be driven by end user's preferences.

Like before you start building a house, you understand preferences of each member in the house.
Read 5 tweets
14 Dec
💜 DSA Mostly Asked Questions [2]

🔥🔥 Covering 4️⃣0️⃣ Algorithms

If you are interested in the 1st of this series, check 👇

Series: 2️⃣
Level: Beginner
Topics:

⇰ Linked List - Concepts
⇰ Linked List - Operations
⇰ Linked List - Algorithms
Read 14 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

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(