toJSON
Returns the matrix in the same plain-object shape as toObject, for passing to
JSON.stringify.
API Reference
Signature
Parameters
Returns
A new plain object with keys ascending and rows copied, suitable for
JSON.stringify. A row undefined serializes to null per native rules.
Throws
Does not throw.
Agent Contract
Agent Notes
- For a string, call
JSON.stringify(Matrix.toJSON(matrix)); the package has noMatrix.toString/Matrix.valueOf. - The returned shape matches toObject.