Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

flatten an array without using .flat();

// flatten an array without using .flat();

let myArray = ["E", "l", "z", ["e", "r"], "o"];


let reduce = myArray.reduce((ele, acc) => `${ele}${acc}`); // OR acc.concat(el)


console.log("Elzero");

// Output Elzero
Comment

PREVIOUS NEXT
Code Example
Javascript :: node.js express post query string 
Javascript :: react function being called every minute 
Javascript :: node server 
Javascript :: jquery get by name 
Javascript :: for object 
Javascript :: js convert date to timestamp 
Javascript :: cypress command return value into variable 
Javascript :: reactjs hello world 
Javascript :: add formdata javascript 
Javascript :: jquery attr 
Javascript :: react pagination 
Javascript :: js create json array 
Javascript :: how to target child element of an event object in JS 
Javascript :: How to get the Class Name of an Object in JavaScript 
Javascript :: nodejs sha512 decrypt 
Javascript :: jquery remove class 
Javascript :: object fromentries example 
Javascript :: How to make blinking/flashing text with jQuery 
Javascript :: mongodb group by several fields 
Javascript :: how to get a toggle button to do different js functions 
Javascript :: jquery div show 
Javascript :: PayloadTooLargeError 
Javascript :: js and 
Javascript :: "SyntaxError: Unexpected token o in JSON at position 1 
Javascript :: jquery ajax get with authentication 
Javascript :: two sum javascript solution 
Javascript :: how to use the onload event n vue js 
Javascript :: set cookie and get cookie in javascript 
Javascript :: js generate random string of length 
Javascript :: percentage formula in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =