diff options
author | Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> | 2022-04-03 18:36:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-03 18:36:55 +0300 |
commit | b5f0b49b9b04ec5d452b78aba5ff5a49dcc1e377 (patch) | |
tree | 22f6c578cf27d47d48c3a9e5a4fb3964d41518f1 /lib | |
parent | ba9e169feafa29a7758c55cfa7ec79ca6081d573 (diff) |
os: avoid unnecessary usage of var
The `var` keyword is known to be problematic and is not needed here,
so better to use the `let` keyword for variable declarations.
PR-URL: https://github.com/nodejs/node/pull/42563
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/os.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/os.js b/lib/os.js index f0f0fdb15f6..c1c4bfa694a 100644 --- a/lib/os.js +++ b/lib/os.js @@ -171,7 +171,7 @@ platform[SymbolToPrimitive] = () => process.platform; * @returns {string} */ function tmpdir() { - var path; + let path; if (isWindows) { path = process.env.TEMP || process.env.TMP || @@ -223,7 +223,7 @@ function getCIDR(address, netmask, family) { } const parts = StringPrototypeSplit(netmask, split); - for (var i = 0; i < parts.length; i++) { + for (let i = 0; i < parts.length; i++) { if (parts[i] !== '') { const binary = NumberParseInt(parts[i], range); const tmp = countBinaryOnes(binary); @@ -261,7 +261,7 @@ function networkInterfaces() { if (data === undefined) return result; - for (var i = 0; i < data.length; i += 7) { + for (let i = 0; i < data.length; i += 7) { const name = data[i]; const entry = { address: data[i + 1], |