Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda