Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/11/2015, 04:35
molinasergio91
 
Fecha de Ingreso: enero-2013
Ubicación: Santa Fe, VT
Mensajes: 68
Antigüedad: 11 años, 3 meses
Puntos: 2
Respuesta: Función que no me retorna valor a un Array.

Buenas

nunca haces la llamada a testFunction, el codigo deberia quedar asi:
Código Javascript:
Ver original
  1. var testArray = new Array();
  2.  
  3. function testFunction () {
  4.  
  5. return testArray.push(Math.floor(Math.random() * (10 - 5) + 5));
  6. }
  7.  
  8. testFunction(); <<<<<<<<<<<<<<<< FALTA ESTO
  9.  
  10. alert (testArray[0]);