“¿Qué hace el retorno en JavaScript?” Código de respuesta

¿Qué hace el retorno en JavaScript?

function add(a, b) {
  return a + b; //Return stops the execution of this function
}

var sum = add(5, 24); //The value that was returned got but inside the variable sum
TC5550

RETURN JS

function square(x) {
   return x * x;
}
var demo = square(3);
// demo will equal 9
Tough Tern

RETURN JS

return [expression];
Tough Tern

Respuestas similares a “¿Qué hace el retorno en JavaScript?”

Preguntas similares a “¿Qué hace el retorno en JavaScript?”

Más respuestas relacionadas con “¿Qué hace el retorno en JavaScript?” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código