![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
12/01/2015, 19:34
|
| | Fecha de Ingreso: enero-2015
Mensajes: 43
Antigüedad: 10 años Puntos: 3 | |
Respuesta: Contar valores especificos ojo
Código:
var MyArray = ['Perro','Gato','Perro','Gato', 'PezGato'];
MyArray.toString().match(/Gato/g) .lenth // => 3
MyArray.toString().replace(/,/g,"\r\n").match(/^Gato$/gm).lenght // =>2
|