![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
07/03/2013, 16:52
|
![Avatar de emprear](http://static.forosdelweb.com/customavatars/avatar187409_1.gif) | Colaborador | | Fecha de Ingreso: junio-2007 Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 17 años, 7 meses Puntos: 1567 | |
Respuesta: Re indexar un array en JavaScript
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript"> //<![CDATA[ var arreglo = {'nombre':'juana', 'apellido':'galvis', 'direccion':'Carrera 12'}; console.log(arreglo['nombre']); //juana for (var llave in arreglo){ console.log(llave); } for (var llave in arreglo){ console.log(llave + '-'+ arreglo[llave]); } //]]>
__________________ La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R. |