Reduce variable scope pollution with const/let

This commit is contained in:
Sam Schloegel
2022-01-05 21:20:35 -05:00
parent 35340b86db
commit 9c16c9c220
13 changed files with 130 additions and 130 deletions
+3 -3
View File
@@ -16,15 +16,15 @@ exports.ready = function (device) {
};
exports.data = function (device, message) {
var msg = message.toString();
const msg = message.toString();
if (msg.substring(0, 5) == 'Ready') {
device.send('getStatus\n');
}
if (msg.substring(0, 5) == 'Reply') {
var arr = msg.split(' ');
const arr = msg.split(' ');
device.data.showName = '';
var i = 0;
let i = 0;
while (arr[i][arr[i].length - 1] != '"') {
i++;
device.data.showName += `${arr[i]} `;