Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357564
D4316.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
999 B
Referenced Files
None
Subscribers
None
D4316.diff
View Options
diff --git a/lib/utils/text-utils.js b/lib/utils/text-utils.js
--- a/lib/utils/text-utils.js
+++ b/lib/utils/text-utils.js
@@ -14,7 +14,7 @@
const comma = maxNumberOfNouns > 2 && nouns.length > 2 ? ',' : '';
if (nouns.length <= maxNumberOfNouns) {
- const prefix = nouns.slice(0, nouns.length - 1).join(', ');
+ const prefix = nouns.slice(0, -1).join(', ');
return `${prefix}${comma} and ${nouns[nouns.length - 1]}`;
} else {
const prefix = nouns.slice(0, maxNumberOfNouns - 1).join(', ');
diff --git a/web/modals/modal-provider.react.js b/web/modals/modal-provider.react.js
--- a/web/modals/modal-provider.react.js
+++ b/web/modals/modal-provider.react.js
@@ -30,7 +30,7 @@
$ReadOnlyArray<[React.Node, string]>,
>([]);
const popModal = React.useCallback(
- () => setModals(oldModals => oldModals.slice(0, oldModals.length - 1)),
+ () => setModals(oldModals => oldModals.slice(0, -1)),
[],
);
const pushModal = React.useCallback(newModal => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 12:17 AM (21 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577778
Default Alt Text
D4316.diff (999 B)
Attached To
Mode
D4316: [lib] [web] Use `slice(0, -1)` instead of `slice(0, ...length - 1)`
Attached
Detach File
Event Timeline
Log In to Comment