Operands of '+' operation must either be both strings or both numbers. Consider using a template literal
1307 try {
1308 reader.readAsText(f);
1309 } catch (err) {
1310 console.log("unable to load JSON: " + f);1311 }
1312 });
1313 }
Operands of '+' operation must either be both strings or both numbers. Consider using a template literal
995 this.updateDeviceRender();
996
997 } else {
998 alert("Version '" + version + "' is not supported by 3DuF !"); 999 }
1000 // Common Code for rendering stuff
1001 // console.log("Feature Layers", Registry.currentDevice.layers);
Operands of '+' operation must either be both strings or both numbers. Consider using a template literal
164 // Generate Manufacturing Layers for each depth
165 let manufacturinglayer: ManufacturingLayer;
166 for (const depth of featuredepthmap.getDepths()) {
167 manufacturinglayer = new ManufacturingLayer(layer.name + "_" + i + "_" + depth);168 const depthfeatures: Array<string> = featuredepthmap.getFeaturesAtDepth(depth);
169 for (const j in depthfeatures) {
170 const featurekey: string = depthfeatures[j];
Description
It is recommended to use operands of the same type while adding values as mismatched operand types might result in unexpected output.
When doing addition with operands of different types, the output sometimes results in simple concatenation instead of addition.
1 + '2'
While the user may expect this to result in 3
(by integer addition) it will instead result in '12'
(by string concatenation) .
Bad Practice
var foo = '5.5' + 5;
var foo = 1n + 1;
Recommended
var foo = parseInt('5.5', 10) + 10;
var foo = 1n + 1n;