Skip to content

Instantly share code, notes, and snippets.

@lucamarogna
lucamarogna / from-consoletable-to-2d-array.js
Last active September 5, 2022 15:24
Reverse a console.table() output, in order to give back the original matrix
/**
* Given original matrix like this:
* [
* ['🍉', '🍒', '🍌'],
* ['🦁', '🦄', '🐼'],
* ['🍕', '🍿', '🍔'],
* ]
* console.table() prints:
* | (index) | 0 | 1 | 2 |
* --------------------------------