diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 2d6ed47d74e29f..96895cae0bd70a 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -522,7 +522,7 @@ class Http2ServerResponse extends Stream { addTrailers(headers) { const keys = Object.keys(headers); let key = ''; - for (var i = 0; i < keys.length; i++) { + for (let i = 0; i < keys.length; i++) { key = keys[i]; this.setTrailer(key, headers[key]); } @@ -606,7 +606,7 @@ class Http2ServerResponse extends Stream { if (headers === undefined && typeof statusMessage === 'object') headers = statusMessage; - var i; + let i; if (Array.isArray(headers)) { for (i = 0; i < headers.length; i++) { const header = headers[i];