10/11 Manos a la obra


#1

El ejercicio arranca así:

var alHelicoptero = function(){
  //¡Escribí acá tu ciclo do/while!
  
};

y yo lo completé así:

var alHelicoptero = function(){
 do{
     console.log("Es raro esto de los ciclos");
 }  
     while(alHelicoptero = true);
 
         //¡Escribí acá tu ciclo do/while!
  
};

El ejercicio pasa como válido pero no me muestra nada en la pantalla de la consola, cuando la consigna dice: "Escribí un ciclo do/while dentro de la función que creamos para vos, alHelicoptero. La función debería registrar una cadena elegida por vos en la ventana de Resultados". [The excercise it´s approved but nothing it´s showed in the console screen. The instrucctions says: "The function should register a chain chosen by you on the result window"]


#2

You need to call the function to see something:

alHelicptero();

but before you do this think about this:

while(alHelicoptero = true);

this is evil! As you might know an assignment has the value you assign so

console.log(variable = value); --> value

So this is evil because of 2 reasons:

First you overwrite your function with true which makes it useless.
Second this has always a value of true no matter what alHelicoptero initially was so you end up in an infinite loop.
Hope this helps and that you can translate this, sry I can speak JavaScript better than spanish :slightly_smiling:


#3

thanks. And yes, i can read it in english :wink: