Js array recursive loop

cyclic array

arr = [
   [1, 2],
   [3, 4],
]

output [13,14,23,34] ;

cyclic array

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

output [135136145146235236245246]

The length of the array of the

loop is unknown, and the length of each subarray of the array is unknown.

do you want to write a general method?

Mar.02,2021

use the array reduce method
let arr = [[1,2], [3,4], [5,6]]
let list = []
arr.reduce ((pre, current, index, arr) = > {

list = []
for (let i = 0; i < pre.length; iPP) {
    for (let j = 0; j < current.length; jPP) {
        list.push(+(pre[i] + '' + current[j]))
    }
}
return list

})

console.log (list)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35ff3-2bfbf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35ff3-2bfbf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?