Prefer var declarations be placed at the top of their scope JS-0102
Anti-pattern
Minor
6 months ago3 years old
All 'var' declarations must be at the top of the function scope
1417        },
1418      ],
1419    };
1420    var check = intersectionCheck(geoJson);1421    //join array elements with whitespace and comma
1422    req.body["yirmibesbin"] = check.yirmibes.join(", ");
1423    req.body["yuzbin"] = check.yuz.join(", ");
All 'var' declarations must be at the top of the function scope
1400      req.body["datum"]
1401    );
1402    coordinates.push([parseFloat(close.lng), parseFloat(close.lat)]);
1403    var geoJson = {1404      type: "FeatureCollection",1405      features: [1406        {1407          type: "Feature",1408          properties: {1409            mytag: "datdat",1410            name: "datdat",1411            tessellate: true,1412          },1413          geometry: {1414            type: "Polygon",1415            coordinates: [coordinates],1416          },1417        },1418      ],1419    };1420    var check = intersectionCheck(geoJson);
1421    //join array elements with whitespace and comma
1422    req.body["yirmibesbin"] = check.yirmibes.join(", ");
All 'var' declarations must be at the top of the function scope
1393      coordinates.push([cornerPoint.lng, cornerPoint.lat]);
1394    }
1395
1396    var close = converter(1397      parseFloat(corners[0].split(",")[0]),1398      parseFloat(corners[0].split(",")[1]),1399      req.body["zone"].length > 1 ? req.body["zone"][0] : req.body["zone"][0],1400      req.body["datum"]1401    );1402    coordinates.push([parseFloat(close.lng), parseFloat(close.lat)]);
1403    var geoJson = {
1404      type: "FeatureCollection",
All 'var' declarations must be at the top of the function scope
1384      var x = parseFloat(cornerCoordinates[0]);
1385      var y = parseFloat(cornerCoordinates[1]);
1386
1387      var cornerPoint = converter(1388        x,1389        y,1390        req.body["zone"].length > 1 ? req.body["zone"][i] : req.body["zone"][0],1391        req.body["datum"]1392      );1393      coordinates.push([cornerPoint.lng, cornerPoint.lat]);
1394    }
1395
All 'var' declarations must be at the top of the function scope
1382      var corner = corners[i];
1383      var cornerCoordinates = corner.split(",");
1384      var x = parseFloat(cornerCoordinates[0]);
1385      var y = parseFloat(cornerCoordinates[1]);1386
1387      var cornerPoint = converter(
1388        x,