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:
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.
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.
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…
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…