There are multiple ways to find out the largest value of an array. One way is to use `Math.max()` function to find the largest value.

But often interviewer may ask you to write a for loop to find the largest value of an array. Let’s do the same exercise with for loop.

Also, we can write a reusable function to find the largest element of an array.


Like finding the largest number, there are multiple ways to find the sum of all numbers in an array.

We can calculate the sum using for loop:

We can…

Before begin I want to let you know this is not the complete guide of react fundamental rather this is introductory guide of react fundamental concepts. I will discuss 10 fundamental concepts about react that you must know as a react developer.

1. What is React anyways?

React is a JavaScript ‘library’ not a ‘framework’ developed by Facebook . With framework like angular, vue the control is inverted means framework will made decision for you, whereas with library like react you can make your own decision, you are in control. React helps builds user interfaces for single-page applications (SPA) by dividing UI reusable React library…

Block Bindings

Usually bindings occur whenever we declare or set value in a variable. For example we use var, let and const to declare or assign a variable.

var a = 1;
let b = 2;
const c = 3;

This blog demonstrates how var and hoisting occurs and what are the best practices ES6 offers for block bindings using var, let and const.

Var Declarations and Hoisting

When variable declared with var they are hoisted to the top of the function or global scope if declared outside a function.

var declarations are treated as if they are hoisted to the top of the function (enclosing…

Arrays are one of the most popular and useful object in JavaScript. There are lots of build in properties and method associated with arrays. I have listed top array methods every developer should know and make their life easier when dealing with arrays.

  • push()
  • pop()
  • shift()
  • unshift()
  • concat()
  • slice()
  • splice()
  • reverse()
  • every()
  • join()
  • forEach()
  • map()
  • filter()
  • find()
  • reduce()
  • sort()


push append element to the end of an array.

let products = ['chairs', 'tables', 'binders', 'paper', 'copiers'];
newProducts = products.push('phones');
// Output: 6
// Output: [ 'chairs', 'tables', 'binders', 'paper', 'copiers', 'phones' ]

pop extract the last element…

Faisal Akbar

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