- for (const machineName in options) {
- if (options.hasOwnProperty(machineName)) {
- $select.append(
- $(`<option ${machineName === selected ? ' selected="selected"' : ''}></option>`).val(machineName).text(options[machineName]),
- );
- totalOptions++;
- }
- }
+ Object.keys(options || {}).forEach(machineName => {
+ $select.append(
+ $(
+ `<option ${
+ machineName === selected ? ' selected="selected"' : ''
+ }></option>`,
+ )
+ .val(machineName)
+ .text(options[machineName]),
+ );
+ totalOptions++;
+ });