Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda