Skip to content

Improve clarity of example comments #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ assert.deepEqual(findLastIndex(arr, isNumber), 3);
```js
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
/* when Array#findLastIndex is not present */
/* when Array#findLastIndex is present */
delete Array.prototype.findLastIndex;
Comment on lines -39 to 40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment refers to the .shim() call being made when it's not present. the delete is so that evalmd doesn't fail in an engine where it is present.

var shimmed = findLastIndex.shim();

Expand All @@ -47,7 +47,7 @@ assert.deepEqual(arr.findLastIndex(isNumber), findLastIndex(arr, isNumber));
```js
var findLastIndex = require('array.prototype.findlastindex');
var assert = require('assert');
/* when Array#findLastIndex is present */
/* when Array#findLastIndex is not present */
var shimmed = findLastIndex.shim();
Comment on lines -50 to 51
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly, it's present here for this shim() call


assert.equal(shimmed, Array.prototype.findLastIndex);
Expand Down
Loading