mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:57:46 +00:00
Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which of these words to use. Let's just choose one and use it everywhere. :^)
This commit is contained in:
parent
7ae7170d61
commit
3d4afe7614
29 changed files with 139 additions and 139 deletions
|
@ -79,21 +79,21 @@ describe("normal behavior", () => {
|
|||
}, 100);
|
||||
expect(result).toBe(121);
|
||||
|
||||
var indexes = [];
|
||||
var indices = [];
|
||||
result = ["foo", 1, true].reduce((a, v, i) => {
|
||||
indexes.push(i);
|
||||
indices.push(i);
|
||||
});
|
||||
expect(result).toBeUndefined();
|
||||
expect(indexes.length).toBe(2);
|
||||
expect(indexes[0]).toBe(1);
|
||||
expect(indexes[1]).toBe(2);
|
||||
expect(indices.length).toBe(2);
|
||||
expect(indices[0]).toBe(1);
|
||||
expect(indices[1]).toBe(2);
|
||||
|
||||
indexes = [];
|
||||
indices = [];
|
||||
result = ["foo", 1, true].reduce((a, v, i) => {
|
||||
indexes.push(i);
|
||||
indices.push(i);
|
||||
}, "foo");
|
||||
expect(result).toBeUndefined();
|
||||
expect(indexes).toEqual([0, 1, 2]);
|
||||
expect(indices).toEqual([0, 1, 2]);
|
||||
|
||||
var mutable = { prop: 0 };
|
||||
result = ["foo", 1, true].reduce((a, v) => {
|
||||
|
|
|
@ -84,21 +84,21 @@ describe("normal behavior", () => {
|
|||
}, 100);
|
||||
expect(result).toBe("100123456");
|
||||
|
||||
var indexes = [];
|
||||
var indices = [];
|
||||
result = ["foo", 1, true].reduceRight((a, v, i) => {
|
||||
indexes.push(i);
|
||||
indices.push(i);
|
||||
});
|
||||
expect(result).toBeUndefined();
|
||||
expect(indexes.length).toBe(2);
|
||||
expect(indexes[0]).toBe(1);
|
||||
expect(indexes[1]).toBe(0);
|
||||
expect(indices.length).toBe(2);
|
||||
expect(indices[0]).toBe(1);
|
||||
expect(indices[1]).toBe(0);
|
||||
|
||||
indexes = [];
|
||||
indices = [];
|
||||
result = ["foo", 1, true].reduceRight((a, v, i) => {
|
||||
indexes.push(i);
|
||||
indices.push(i);
|
||||
}, "foo");
|
||||
expect(result).toBeUndefined();
|
||||
expect(indexes).toEqual([2, 1, 0]);
|
||||
expect(indices).toEqual([2, 1, 0]);
|
||||
|
||||
var mutable = { prop: 0 };
|
||||
result = ["foo", 1, true].reduceRight((a, v) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue