josdejong / mathjs

An extensive math library for JavaScript and Node.js

Home Page:https://mathjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues in documentation for parsing

dvd101x opened this issue · comments

Hi,

Documentation states that in a parser getAll() retrieves a map, but it's an object.

- `getAll()`
Retrieve a map with all defined a variables from the parser's scope.

The one that retrieves a map is getAllAsMap but it's not documented, fixing the grammatical error of "defined a variables" probably should be:

  • getAll()
    Retrieve an object with all defined variables in the parser's scope.
  • getAllAsMap()
    Retrieve a map with all defined variables in the parser's scope.

Reference

/**
* Get a map with all defined variables
* @return {Object} values
*/
Parser.prototype.getAll = function () {
return toObject(this.scope)
}
/**
* Get a map with all defined variables
* @return {Map} values
*/
Parser.prototype.getAllAsMap = function () {
return this.scope
}

Good find, we should update and clarify the docs!

Fixed via #3158

The fix is now published in v12.4.0