You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/expressions/parsing.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -234,3 +234,31 @@ Some care is taken to mutate the same object that is passed into mathjs, so they
234
234
For less reliance on this blacklist, scope can also be a `Map`, which allows mathjs expressions to define variables and functions of any name.
235
235
236
236
For more, see [examples of custom scopes](../../examples/advanced/custom_scope_objects.js).
237
+
238
+
## Serialization
239
+
240
+
All mathjs data types can be serialized. A scope containing variables can therefore be safely serialized too. However, in the expression parser it is possible to define functions, like:
241
+
242
+
```
243
+
f(x) = x^2
244
+
```
245
+
246
+
Such a custom function cannot be serialized on its own, since it may be bound to other variables in the scope.
247
+
248
+
A [`Parser`](#parser) can safely serialize all variables and functions evaluated via the expression parser:
0 commit comments