=> a.concat( Array.isArray(v) ? flatten(v) : v ), []);
                  
                  
                  
                  
                  
                  const arr = ["♥️", "♣️", "♦️", "♠️"]
                  
                  
                    .map(symbol => [
                  
                  
                      "A",
                  
                  
                      ...Array(9).fill(0).map((e, i) => i+2),
                  
                  
                      ..."JQK".split(""),
                  
                  
                    ].map(number => `${number} ${symbol}`))
                  
                  
                  
                  
                  
                  console.log(flatten(arr))
                  
                  
                
Minified this is 253 chars
This is my solution at 97 chars (Using ramda): map(apply(concat),xprod(unnest(['A',map(String,range(2,11)),'J','Q','K']),['♥️','♣️','♦️','♠️']))
Обсуждают сегодня