![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
21/02/2011, 19:25
|
![Avatar de zerokilled](http://static.forosdelweb.com/customavatars/avatar299260_10.gif) | Javascripter | | Fecha de Ingreso: abril-2009 Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años, 9 meses Puntos: 1485 | |
Respuesta: Definir variables al llamar a la funcion utiliza un objeto literal donde tu mismo defines las propiedades.
Código:
function fn(param){
setTimeout(function(){alert(param.author +": "+ param.msg);}, param.time);
}
fn({msg:"hola", author:"mr who", time:500});
__________________ la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad. |