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 “.” …


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…


Wikipedia definition of obfuscation is

“In software development, obfuscation is the deliberate act of creating source or machine code that is difficult for humans to understand. Like obfuscation in natural language, it may use needlessly roundabout expressions to compose statements.”

Pre-requisites for this article

  1. Basic knowledge on Mobile application development.
  2. How to Generate executables in Android.
  3. Basics knowledge on Mobile Application development using Ionic.

Note: For this article, I’m not using iOS executable(ipa). As it is generally difficult to get the iOS executable, unless you jail break iOS device. It is less vulnerable to attack compared to Android Applications.

Let’s…


Wikipedia definition of Memoization is

In computing, memoization or memoization is an optimisation technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.

In simple words, rather executing a code snippet repeatedly to perform a particular task, we can save the results of previous computation and use it later to avoid unnecessary computation.

Let’s start with a simple example, let’s create a function named add that adds number 10 to parameter that is passed as an argument.

const addTen = function(num){ return num…

If your reading this article, then you want to know about Redux in React Native and already read few blogs and watched some youtube videos but still things are not clear for you !!

Don’t worry I was also in the same place some months back when I first tried understanding the Redux, definitely it is not a complicated topic, but difficult to grasp at one go. And examples on the internet are quite complex to understand for the beginner. So I will create a simplest example so that you will understand it very clearly.

First thing first the terminologies


Say you have a basic HTML page where 3 div’s are nested and there is a click event associated with each div, (Refer example code below)

<html><body>
<div id="GrandParent" onClick="grandParentFunction()">
<h1>Grand Parent</h1>
<div id="Parent" onClick="parentFunction()">
<h1> Parent</h1>
<div id="child" onClick="childFunction()">
<h1> Child</h1>
</div>
</div>
</div>
<script src="./index.js" />
</body>
<html>

index.js contents

document.getElementById("GrandParent").addEventListener('click', () => {console.log("Grand Parent clicked")})document.getElementById("Parent").addEventListener('click', () => {console.log("Parent clicked")})document.getElementById("Child").addEventListener('click', () => {console.log("child clicked")})

Before reading further guess what will the output when you click on the child div ?

Whenever you click on the child div, internally you're…


Personally I’m from Java Background, my view towards the Inheritance was totally different then the JavaScript Inheritance. For a beginner, concept of Inheritance in JavaScript is quite tricky to understand. The purpose of this article is to elaborate all aspects of Inheritance in JavaScript step by step, so stay with me.

What is Inheritance ?

Inheritance in Object Oriented Programming language is a mechanism in which base class acquires all the properties and behaviors of the parent class. It is an important part of OOPs (Object Oriented programming system). The idea behind inheritance in Java is that you can create…


Unlike strongly typed languages like Java, C, C++ sometimes JavasScript doesn’t behave the way we expect it to be. Consider below example

console.log(“colour is”, colour);var colour;

The usual expectation here would be Reference error as we are trying to access a variable before it is being defined. But the actual output is

colour is undefined

You would be wondering how is this possible ? before explaining that consider below code snippet with slight modification.

console.log(“colour is”, colour);let colour;

Because of above explanation one would expect output should be colour is undefined, here as well. But the output would…

Vasanth Bhat

React Native developer with crazy 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