From 01921f1114f1f67248a6228da326c003d5f3bffd Mon Sep 17 00:00:00 2001 From: Mohammed Keyvanzadeh Date: Fri, 1 Apr 2022 15:14:30 +0430 Subject: [PATCH] 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. --- lib/os.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/os.js b/lib/os.js index f0f0fdb15f61c0..c1c4bfa694a06b 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],