in the above example, you have seen there is a repeating now I want to remove all continuous value only (not duplication) and keep 1st element of each repeating value

we can achieve that using array filter method

Javascript filter accept callback function and that callback function accept 3 arguments

- element: it's return an current element
- index(optional): it's return index current element
- array(optional): it's return actual array on which filter is perform

so in above code we first check if element index is 0 or current element is not match with previous element then we return that element

Share this blog with your friends π©πΌπ€π§πΌ and developers π¨π» you know and let them know about these

Your feedback and comments are very important to me. π

** exponentiation operator raising the first operand to the power of the second

more details explanation click here

**~~** double bitwise not operator rounding a number towards zero

more details explanation click here

Share this blog with your friends π©πΌπ€π§πΌ and developers π¨π» you know and let them know about these cool math function shorthand

Your feedback and comments are very important to me. π

**charAt method returns the character at the specified index in a string**

**charCodeAt method returns Unicode of the character at the specified index in a string**

**substr extracts the characters from a string, beginning at a specified start position, and through the specified number of character**

**substring Extracts the characters from a string, between two specified indices**

**toLowerCase converts a string to lowercase letters**

**toUpperCase converts a string to uppercase letters**

**trim remove white space from start and end of string**

**repeat returns a new string with a specified number of copies of an existing string**

**startsWith method is used to check whether a string starts with a specific word or not. it returns true or false **

**endsWith is used to check whether a string ends with a specific word or not. it returns true or false **

Share this blog with your friends π©πΌπ€π§πΌ and developers π¨π» you know and let them know about these cool string functions

Your feedback and comments are very important to me. π

**Math.abs function returns the absolute value of a number**

**Math.ceil function rounds a number up to the next largest integer**

**Math.floor function rounds a number down to its nearest integer**

**Math.round function rounds a number to its nearest integer**

**Math.trunc function returns the integer part of a number**

**Math.max function returns the number with the largest value**

**Math.min function returns the number with the lowest value**

**Math.pow function returns the base to the exponent power**

**Math.sqrt function returns the square root of a number**

**Math.cbrt function returns the cubic root of a number**

**Math.random return random number between 0 to 1**

**Math.sign return an argument is negative, positive or NaN**

Share this blog with your friends π©πΌπ€π§πΌ and developers π¨π» you know and let them know these

Your feedback and comments are very important to me. π

**push method adds one or more element at the end of an array**

**pop is removed the last element of the array & return that element**

**A shift method removes the first element from the array and all other element indexes decrease by 1**

**unshift method adds a new element at the beginning of an array and all other element indexes increase by 1**

**concat method concat two or more array and return a new array**

**reverse method reverses and returns the array**

**A slice method return portion of an array as a new array without touching the existing array it's accepted 2 optional arguments start index & end index**

**splice method uses to add or remove an element from an array. It's accepted 3 argument start index, delete count & new elements, it's return deleted elements.**

**find method return a 1st element that match with given test**

**filter method returns an element that matches with given test**

**some method returns true or false if one of the array element is pass in test condition **

**every method checks whether all elements in an array pass the applied test and return true if pass else false**

**map method creates a new array with result to apply given function to each element**

**sort method short array in alphabetical order. it's sort array values as strings**

**reduce method reduces the array to a single value from left to right**

Share this blog with your friends π©πΌπ€π§πΌ and developers π¨π» you know and let them know these

Your feedback and comments are very important to me. π