You should eliminate this check by using things that are already part of the class. [`matrix.isSquare()`](https://github.com/StDako/numbers.js/blob/master/lib/numbers/matrix.js#L48-56)