Horje
advanced data manipulation javascript Code Example
advanced data manipulation javascript
var flattenedArray = [];var coloursArray = [ [“blue”, “green”], [“green”, “black”, “orange”, “blue”], [“green”, “red”] ]flattenedArray = coloursArray.reduce( (total, subArray)=>{ return total.concat(subArray)},[]);console.log(flattenedArray)["blue", "green", "green", "black", "orange", "blue", "green", "red"]
Source: medium.com
advanced data manipulation javascript
var array = [“blue”, “green”, “green”, “black”, “orange”, “blue”, “green”, “red”];var uniqueArray = [];uniqueArray = array.filter((element, index, array)=>{ return array.indexOf(element) === index;})console.log(uniqueArray)["blue", "green", "black", "orange", "red"]
Source: medium.com




Javascript

Related
network information api js Code Example network information api js Code Example
bash json creator Code Example bash json creator Code Example
make python editor with code codemirror javascript Code Example make python editor with code codemirror javascript Code Example
eventlistener dark mode Code Example eventlistener dark mode Code Example
how to accept only. proper email from an input field react with functional component Code Example how to accept only. proper email from an input field react with functional component Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11