Practice makes perfect


Hello all.
My program keeps crashing due to it being an infinite loop but i don't know how to make it stop.
Here is my code:
var count = 0;

var loop = function(){
while(count <= 3){
console.log("I'm looping!")


Any help would be great.


count++ should be after console.log
console.log("I'm looping!")

Any question?


Thats great... thank you
One question what is the loop() at the end do?


The code in a function is not executed when the function is defined. It is executed when the function is invoked.
Some people use the term "call a function" instead of "invoke a function".
so here loop is a function so you need to call it.
do more function as many as you can to make sense



var ciclo = function()
var ciclo = 0

	return"¬°Estoy en un bucle!"+" "+ ciclo





under console.log
count ++
and where you have the count ++ change to count


@2gether This is a reply on which comment?
@webrockstar94596 By using return you exit the function, so using it in a loop will quit the function in the first cycle.


this works, remember using return
var count = 0;

var loop = function(count ){
while(count ++){
//Your code goes here!
return"I am looping!"+" "+ count



loop(count ++);