concat

concat () is the output of two arrays together. Excerpted below:

const friendsName = ["Liton", "Asraful", "Rimon", "Rana"]
const newFriendsName = ["Rayhan", "Rubel", "Mominur", "Ashik"]
const allFriends = friendsName.concat(newFriendsName);
output:["Liton", "Asraful", "Rimon", "Rana", "Rayhan", "Rubel", "Mominur", "Ashik"]

every()

every () is a function with which you can verify a condition and it will output you a boolean number such as Truee / false. One thing you have to remember is that every means ‍arrey must match all the numbers. The example itself is given-

const number = [10, 20, 25, ,11, 26, 77, 53, 99, 80, 60, 70];
const result = (bigNumber) => bigNumber < 100;
console.log(number.every(result))
output- true

filter()

filter () is also a functional condition. You can use the filter to find any one of the specified genes. Such as:

const friendsNameWord = ['Liton', 'Rimon', 'Asrafull', 'Rana', 'Ashik']
const result = friendsNameWord.filter(word => word.length < 6);
console.log(result);
output- Array ["Liton", "Rimon", "Rana", "Ashik"]

find()

find () is a conditional search. The important thing is that when the first condition is matched, the next condition will not be checked. Such as:

const number = [1, 55, 77, 99, 22, 33];
const result = number.find(element => element > 12);
console.log(result);
output- > 55

Findindex()

findIndex () is used to locate the number of an object. Such as:

const number = [10, 50, 70, 60, 90, 58];const smallNumber = (element) => element > 30;console.log(number.findIndex(smallNumber));

forEach

forEach () is to repeat every element of an array. Such as:

const friendName = ["Liton", "Sojib", "Rimon", "Asraful", "Rana"]friendName.forEach(element => console.log(element))output: > "Liton"> "Sojib"> "Rimon"> "Asraful"> "Rana"

indexOf()

The position of a specific element is found using indexOf (). Such as:

const friendName = ["Liton", "Sojib", "Rimon", "Asraful", "Rana"]console.log(friendName.indexOf("Rimon"));output: > 2

join()

You will get a new string using join (). Such as:

const friendName = ["Liton", "Sojib", "Rimon", "Asraful", "Rana"]const friendName = ["Liton", "Sojib", "Rimon", "Asraful", "Rana"]console.log(friendName.join());output: > "Liton Sojib Rimon Asraful Rana"

map

Using map () you can repeat all the elements inside any arrey and write it down and you can run any operation. Via a callback function. Such as:

const number = [1, 5, 9, 20]const map = number.map(number => number * 2)console.log(map)outpur: > Array [2, 10, 18, 40]

pop

JavaScript uses the pop () method to remove or delete a value from the end of an array.

const country = ["bangladesh", "Srilanka", "Amrica", "England"]country.pop();console.log(country)output: > Array ["bangladesh", "Srilanka", "Amrica"]

push

In JavaScript, the push () method is used to add a value to the end of an array.

const number = [55, 33, 22, 66, 44, 77, 88, 11];const addNumber = number.push(20);console.log(number);> Array [55, 33, 22, 66, 44, 77, 88, 11, 20]

Reduce()

reduce () is an array that adds all the elements and gives one element. Such as:

const number = [1, 3, 5, 7]const most = (acemulator, currentValue) => acemulator + currentValue;console.log(number.reduce(most));output: > 16

reverse()

reverse () is to shorten an element. Such as:

const name = ["Liton", "Rimon", "Asraful", "Rana"]console.log('FriendName:', name);output: > "FriendName:" Array ["Liton", "Rimon", "Asraful", "Rana"]

shift()

In JavaScript, the shift () method is used to remove or delete a value from the beginning of an array.

const name = ["Liton", "Asraful", "Rimon", "Rana"]console.log(name.shift())> "Liton"

Slice()

To create a new array by cutting out a specific part of an array in JavaScript, you need to use the slice () method.

const number = [33, 44, 66, 88, 99]console.log(number.slice(2));output- > Array [66, 88, 99]

sort()

sort () is an array element used for arranging. Such as:

const number = [1, 33, 99, 22, 20, 2]
console.log(number.sort())
output-> Array [1, 2, 20, 22, 33, 99]

unshift()

unshift () is to add a new element to an arrey. Such as:

const number = [1, 6, 9, 10]
console.log(number.unshift(22, 50))
output: 6

Web Developer

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