Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Is there a better way to write my Javascript while loop

$
0
0

I have the loop below in an array result.entities, I want it to loop through until there are no more records. I don't know the total number of records however. The code below works but I get an error at the end.

{

                contact =  result.entities[0];
                    
                    if (contactC != null)
                    {
                     
                     while (contactC != null)
                      {
   	
                      	contactC =  result.entities[i].name;
                      	alert(contactC);
                      	
                      	i++;

                      }
                    
                    }
                    
                }




Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>