Skip to content

Commit 2cf6a05

Browse files
VoltrexKeyvajuanarbol
authored andcommitted
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: #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>
1 parent eaae319 commit 2cf6a05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/os.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ platform[SymbolToPrimitive] = () => process.platform;
171171
* @returns {string}
172172
*/
173173
function tmpdir() {
174-
var path;
174+
let path;
175175
if (isWindows) {
176176
path = process.env.TEMP ||
177177
process.env.TMP ||
@@ -223,7 +223,7 @@ function getCIDR(address, netmask, family) {
223223
}
224224

225225
const parts = StringPrototypeSplit(netmask, split);
226-
for (var i = 0; i < parts.length; i++) {
226+
for (let i = 0; i < parts.length; i++) {
227227
if (parts[i] !== '') {
228228
const binary = NumberParseInt(parts[i], range);
229229
const tmp = countBinaryOnes(binary);
@@ -261,7 +261,7 @@ function networkInterfaces() {
261261

262262
if (data === undefined)
263263
return result;
264-
for (var i = 0; i < data.length; i += 7) {
264+
for (let i = 0; i < data.length; i += 7) {
265265
const name = data[i];
266266
const entry = {
267267
address: data[i + 1],

0 commit comments

Comments
 (0)