Skip to content

Instantly share code, notes, and snippets.

View enisinanaj's full-sized avatar
🎯
Focusing

Eni Sinanaj enisinanaj

🎯
Focusing
View GitHub Profile
/**
* Return a table string representation of the matrix
* @param {Array} matrix The matrix
* @param {String} prop The property to print
*/
function stringifyMatrix(matrix, prop = "originalValue") {
return matrix
.map((e) => e.map((e) => (prop === "" ? String(e) : e[prop])))
.join("\n")
.replace(/\,/g, " ");