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 => {