From 8e66b0c804b16c47cf2680060e6d523c0d64d624 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 18 Jun 2025 13:55:44 -0400 Subject: [PATCH] fix(browser): Remove usage of Array.at() method --- .../src/metrics/web-vitals/lib/LayoutShiftManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/browser-utils/src/metrics/web-vitals/lib/LayoutShiftManager.ts b/packages/browser-utils/src/metrics/web-vitals/lib/LayoutShiftManager.ts index 76de0eb8290c..c9171b56ef0c 100644 --- a/packages/browser-utils/src/metrics/web-vitals/lib/LayoutShiftManager.ts +++ b/packages/browser-utils/src/metrics/web-vitals/lib/LayoutShiftManager.ts @@ -30,7 +30,8 @@ export class LayoutShiftManager { if (entry.hadRecentInput) return; const firstSessionEntry = this._sessionEntries[0]; - const lastSessionEntry = this._sessionEntries.at(-1); + // This previously used `this._sessionEntries.at(-1)` but that is ES2022. We support ES2021 and earlier. + const lastSessionEntry = this._sessionEntries[this._sessionEntries.length - 1]; // If the entry occurred less than 1 second after the previous entry // and less than 5 seconds after the first entry in the session,