For example
if (!hits) {
for (let i = 0; i < design.design_parameters.length; i++) {
var dp = design.design_parameters[i];
if (dp.name.startsWith(subcommand)) {
putdpsv(dp.name, dp.value, dp.units, dp);
hits = true;
}
}
}
to
if (!hits) {
design.design_parameters.forEach(function(dp) {
if (dp.name.startsWith(subcommand)) {
putdpsv(dp.name, dp.value, dp.units, dp);
hits = true;
}
}
}
This is more of a Javascript idiom, and simplifies the code.
For example
to
This is more of a Javascript idiom, and simplifies the code.