Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript datamatrix parser

var arr2d = [['red', 'blue'],['cotton','polyester','silk'],['large','medium','small']]

function combos(list, n = 0, result = [], current = []){
    if (n === list.length) result.push(current)
    else list[n].forEach(item => combos(list, n+1, result, [...current, item]))
 
    return result
}

console.log(combos(arr2d))
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Javascript :: varibale as listeneres javascirpit 
Javascript :: Declare JSON Variable In Another File 
Javascript :: nodejs passport starter template with username and password 
Javascript :: Odoo Javascript Modules 
Javascript :: input json decode 
Javascript :: Importing Ky Module In JavaScript 
Javascript :: Create A Class Using JavaScript 
Javascript :: phaser matrix rotate 
Javascript :: select final 2 indexes in JS 
Javascript :: how to install ghost js 
Javascript :: Sorting the Odd way! 
Javascript :: wait for element to be loaded 
Javascript :: ip scanner node 
Javascript :: repate element every 2 seconds 
Javascript :: repeated click onchange javascript 
Javascript :: checkbox null value javascript 
Javascript :: Toggle child element onclick of parent element 
Javascript :: ahead-of-time (AOT) compilation 
Javascript :: how to check bot channel permissions 
Javascript :: vue2-datepicker nuxtjs example 
Javascript :: use spread operator in max method javascript 
Javascript :: name of javascript virtual machine for apple 
Javascript :: A Note on Jest & React 
Javascript :: java script return array 
Javascript :: password generator javascript 
Javascript :: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 
Javascript :: how to validate multiple input field in javascript 
Javascript :: button prevent default 
Javascript :: animation js 
Javascript :: _.isString 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =