Welcome to MoiK78 blog. Your daily intake of Internet news. This is a personal site so I post whenever I can :) but I'll try to get it daily. Be free to email me any suggestion. El bolg de Moisés García sobre tecnologías de internet y programas de diseño.
Homepage About Me Contact Me Buy at MoiK78 online shop Downloads

Welcome to MoiK78 blog, your daily intake of internet and technology news.

Picasa Web Albums My Picasa Photo Albums / Albumes de Fotos

November 12, 2002

Today, custom Array methods.
First one counts how many times a value exist in an Array:
Array.prototype.Count=function(value) {
var cont;
for(var i=0;i < this.length;++i){
if(this[i] == value){
return cont;

myArray = new Array("apple","pear","apple","orange");
countApples = myArray.Count("apple")

countApples = 2

Site Meter