Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

two array in one js

let arr1 = ["item1", "item2", "item3"]
let arr2 = ["item4", "item5", "item6"]

let arr3 = arr1.concat(arr2) //[ 'item1', 'item2', 'item3', 'item4', 'item5', 'item6' ]
Comment

from array create two arrayjavascript

//If you find something better, please, let me know :(
let arr = [[1,2],[3,4],[5,6]]
let [arr1, arr2] = [[], []]
arr.map((e) => { arr1.push(e[0]); arr2.push(e[1]) })
console.log(arr1,arr2) // [[1,3,5],[2,4,6]]
Comment

PREVIOUS NEXT
Code Example
Javascript :: export default method vue 
Javascript :: angular list contains property 
Javascript :: angularjs find and update object in array 
Javascript :: starting express server 
Javascript :: how to get current month in express js 
Javascript :: react native making bigger hitbox 
Javascript :: javasript document referrer 
Javascript :: If statement discord js 
Javascript :: how to get all the voice channels in discord js 
Javascript :: uppercase javascript using function 
Javascript :: javascript create array with repeated values 
Javascript :: math.min 
Javascript :: js how to filter only real numbers from decimals 
Javascript :: socket.io how do i get a list of connected sockets clients 
Javascript :: youtube set speed command 
Javascript :: default Electron icon is used reason=application icon is not set 
Javascript :: how to add number in string in javascript 
Javascript :: how to find date in a string js 
Javascript :: send x-www-form-urlencoded request nodejs 
Javascript :: react webpack.config.js 
Javascript :: mongodb replace root 
Javascript :: js code sample 
Javascript :: angular print json 
Javascript :: fetch method in javascript 
Javascript :: react native vector icons not showing 
Javascript :: get position of element relative to document 
Javascript :: send csrf token ajax laravel 
Javascript :: add toolbar button quill.js 
Javascript :: map list in javascript 
Javascript :: how to validate phone number regex javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =