We hear this a lot, everything is object is in JavaScript, okay, well, how you saying that ? how to prove everything (like function, array, class and variables) is Object in JavaScript ? Let’s get started with simple example.

Open your favourite browser (mine is Chrome) open inspect window(ctrl+shift+i is the shorcut on windows) and click on console. And create an array like the screenshot shown below.

Observe the Image carefully, we just created an array named arr and in the next line if we type arr followed by a “.” …

If you have landed on this page, most likely you know what is async and await and at some point in time you might have got this question in your mind are they really blocking JavaScript main thread ?

What are async and await ?

I believe most of your aware of it, for those of you who are not clear, here is the quick explanation.

Let’s say you want to make an API call using promise, and response of that API call has to be passed to another promise and again response of that promise you want to transfer…

It’s known to all how React Native is becoming the go-to framework for developing Android and iOS applications.

In the initial days, just the startups and POC projects were being developed in React Native, and eventually, the big players like Swiggy, Flipkart, Walmart, etc, adopted it. With larger adoption, it is very important to handle security aspects. Below are the few primary aspects of security that every React Native application must follow.

  1. Storing user details: It is very important for every application to store some user details like AUTH token, user name, email, etc. in the device storage. Whenever you’re…

Most of you might have an idea what are pure functions, in-fact initially I had no intention of writing an article regarding this topic as it is very straight forward. But in an interview I was asked multiple variants of the pure function and I was unable to answer. So thought of writing a detailed explanation which would help audience.

What are pure functions?

In simple words these are the functions whose output strictly depends upon the input passed and there are no side effect. For ex: consider below example to calculate the area of square.

function areaOfSquare(length, breadth){
return length…

If you directly landed upon this article, then before reading any further, read my previous article on how to implement linked lists in JavaScript here.

How to reverse a linked list in JavaScript

Sample input and output

Input 1 = 10–> 20 -> 30 -> 40 -> Null

Output 1 = 40 -> 30 -> 20 → 10 -> null

Input 2 = Null

Output 2 = null

This is one of the very common question asked in most of the interviews. …

Photo by Arif Riyanto on Unsplash

If you directly landed upon this article, then before reading any further, read my previous article on how to implement linked lists in JavaScript here.

I assume you have read my previous articles on linked lists and you know how linked lists work in JavaScript. And that you also know how to implement the basic operations of linked lists like adding a node, printing the list, etc, in JavaScript.

Now let us start with some advanced questions. I have decided to discuss 1–2 questions in each post, so that users are not overwhelmed.

Question 1:

Find the middle element in…

If you directly landed on to this article, then before reading further, read my previous article on how to implement Linked List in JavaScript here.

Assuming you have read my previous article above, you also know that everything is object in JavaScript. Hence, even the Linked List has to be an object. Unlike strongly typed languages like Java, C, C++ which will interact with system memory directly, JavaScript doesn’t interact with system memory; instead, it is fed as a language to an underlying compiler and they will execute the JavaScript code on our behalf and return the result.

Data Structures…

Photo by Markus Spiske on Unsplash

When it comes to the data structures and algorithms round in an interview, JavaScript developers face problems. Not that JavaScript geeks are not good at developing logic, but JavaScript as a language is not-so-friendly in writing complex logics using data structures.

The reason for this is pretty straightforward. JavaScript is an interpreted language, so it does not deal with system memory directly like C, C++, etc.

So, with the help of objects we need to mimic the behavior of different data structures like Trees, LinkedList, HashMap, etc. I have decided to write a series of articles covering these topics. …

Function currying definition:

“Currying is a process in functional programming in which we can transform a function with multiple arguments into a sequence of nesting functions. It returns a new function that expects the next argument inline.”

Let’s start with a simple example where we will write a function that adds two numbers and returns the sum.

function add(a, b){
return a + b;
}
let output = add(10,20);
console.log(output) // output will be 30

As most of you know, above is a simple function that takes 2 arguments, adds it and returns the sum. …

Sometimes I feel JavaScript weird, if your from the background of Java, C, C++ or C# where everything works as per your expectations, JavaScript it isn’t.

consider a simplest example:

function add(x,x){console.log(x+x)
}
add(10,30)

can you guess the output of this ? In most language code block would throw a syntax error. In case of JavaScript the output is 60. Wonder how ? since priority of execution is from left to right, the last value of x in function add will be 30, so 30 + 30 will be 60.

There are many such tricky aspects in JavaScript, one…

Vasanth Bhat

React Native developer with JavaScript fan. Overall 5 years of Software Experience. Coffee lover, likes travelling and writing.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store