what are the applications of loops?

+1 Jeff the Killer · October 21, 2015
the while, do while, for and for loop (if there are other loops care to explain pls.)

Post a Reply

Replies

Oldest  Newest  Rating
0 Jeff the Killer · November 3, 2015
i get
0 Zed elgohary · October 22, 2015
look iam working in field of robots i kind use java in developing apps for some sensors or in some devices that needs a continous check of temprature or gas for example we use the loops an while and do while for that purpose ,... last time i used loop was
when the user the room the bluetooth connection stops ,.... there was a loop for making the device connected to the sensor
then it stops when the user inter :)
other example i tel a dvice in the java or any language "keep checking the temprature untill it reaches 100 switch off the boiler "
did u get anything :ermm:
0 Jeff the Killer · October 22, 2015
thanks for the clarification
+1 Casper Hollemans · October 21, 2015
oooh haha, 
Well if you need to fetch more rows out a database or if you want to check every char of a string you'll need one to.
Like check the input of a username checking on not acceptable characters
0 Jeff the Killer · October 21, 2015
No, what I mean is how are loops useful? 
+2 Casper Hollemans · October 21, 2015
the foreach loop, it's a loop what makes it really easy to loop trough a array,but I don't know a good example in JavaScript.
you coul'd google some tutorials about it.

To explain a bit what it does I cqan write one in php.

foreach(array_name as temp_var){ // temp_var is the value of array_name at the current index
println(temp_var); // yes println is JS, I trie to give you a more js simular example
}
  • 1

Javascript

107,114 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators