Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
how to return this value from my function? is it wrong method?

I don't understand how to solve the following problem when return the value from nested function. is it wrong method. How can I get it? My basic purpose is to get array values (all coordinates) from var mymap_coordinates, but it can't. that's why I use .toString() to test.

*<script>

mymap.on(   //leftlet code
            'contextmenu', 
            function (event) 
            {
                var tg_marker = L.marker(event.latlng, {icon: treegroupIcon}).addTo(mymap);
                store_coordinates[incre_coord] = new Point(tg_marker.getLatLng().lat.toFixed(8), tg_marker.getLatLng().lng.toFixed(8));
                var n = store_coordinates.length;
                var mymap_coordinates = abcdefg(store_coordinates, n);
                window.alert (mymap_coordinates.toString()); //This alert can't print all array value when return the value from abcdefg function
                incre_coord = incre_coord + 1;                              
            }
        );

function abcdefg(points, n)
{
    .......
    .......
    .......
    
    // return Result
    var num = 0;
    var map_coordinate = new Array();
    for (let temp of abc.values())
    {
        map_coordinate[num] = "[" + temp.x + ", " + temp.y + "]";
        num = num + 1;
    }
    window.alert (map_coordinate.toString()); //This alert can print all array value
    return map_coordinate;                   
}
</script>*
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!