Answers for "advanced data manipulation javascript"

0

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"]
Posted by: Guest on August-13-2020
0

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"]
Posted by: Guest on August-13-2020

Code answers related to "advanced data manipulation javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language