Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array flat

let arr = [1,2,3,[4],5,6,[7]]

let asn =arr.flat()

let aa = arr.reduce((t,c,i,a)=>{
return t.concat(c)
},[])

console.log(aa)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #flat
ADD COMMENT
Topic
Name
9+7 =