Javascript Array Includes Method with Example

Javascript Array Includes Method

While building an application, we might be having a scenario where we are using an array and we want to check if that array contains a specific value or object. That’s where Javascript Array Method includes() comes into the play. Usage Javascript array method includes() checks whether an array contains an element. Syntax arr.includes(valueToFind[, fromIndex]) … Read moreJavascript Array Includes Method with Example

Javascript Assignment Operator with Example

Assignment Operator The followings are the assignment operator in javascript: Simple Assignment Additional Assignment Subtraction Assignment Multiplication Assignment Division Assignment Reminder Assignment   Simple Assignment (=) This operator assigns the right operand value to the left operand. var a=’apple’, b=’banana’,c=’cat’; Additional Assignment (+=) This operator adds the value of the right operand to a variable … Read moreJavascript Assignment Operator with Example

Javascript Operators

The task of the operator is to perform some operation on certain values(operands). For example, 10 + 15,where 10 and 15 are left and right operand and + is an operator. Javascript has the following types of operators. Assignment Operator Comparison operators Arithmetic operators Bitwise operators Logical operators String operators Conditional (ternary) operator Comma operator … Read moreJavascript Operators

How to merge multiple arrays in javascript using concat method or spread operator.

When you want to merge two or more arrays, there are following three ways that you can use. concat method spread operator. merge array using push and unshift 1. concat method concat method is used to merge two or more array and it doesn’t alter any existing array but it returns a new array. 1. … Read moreHow to merge multiple arrays in javascript using concat method or spread operator.