doc: revise assert legacy mode text

Revise the text for the `assert` module's legacy mode to make it simpler
and more scannable.

PR-URL: https://github.com/nodejs/node/pull/28315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
Rich Trott 2019-06-19 22:05:44 -06:00
parent 6e66313eb5
commit ad2036fc1a

View File

@ -121,18 +121,21 @@ Please note that this will also deactivate the colors in the REPL.
> Stability: 0 - Deprecated: Use strict mode instead.
When accessing `assert` directly instead of using the `strict` property, the
[Abstract Equality Comparison][] will be used for any function without "strict"
in its name, such as [`assert.deepEqual()`][].
Legacy mode uses the [Abstract Equality Comparison][] in:
It can be accessed using:
* [`assert.deepEqual()`][]
* [`assert.equal()`][]
* [`assert.notDeepEqual()`][]
* [`assert.notEqual()`][]
To use legacy mode:
```js
const assert = require('assert');
```
It is recommended to use the [`strict` mode][] instead as the
[Abstract Equality Comparison][] can often have surprising results. This is
Whenever possible, use the [`strict` mode][] instead. Otherwise, the
[Abstract Equality Comparison][] may cause surprising results. This is
especially true for [`assert.deepEqual()`][], where the comparison rules are
lax: