We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a80cfea commit cc9de1eCopy full SHA for cc9de1e
src/index.js
@@ -68,7 +68,7 @@ export class SparseMatrix {
68
*/
69
to2DArray() {
70
const copy = Array.from({ length: this.rows }, () =>
71
- Array.from({ length: this.columns }, () => 0),
+ new Array(this.columns).fill(0),
72
);
73
this.withEachNonZero((i, j, v) => {
74
copy[i][j] = v;
0 commit comments