var mass = []; mass[4] = 4 mass[9] = 9 mass[8] = 9 alert(mass.join().split(/\d+/).length - 1);
mass.join().replace(/\,{2,}/g, ',').replace(/^\,|\,$/,'').split(',').length
var mass = []; mass[4]=4; mass[9]=9; alert(Object.keys(mass).length)
var mass = []; mass[4] = 4 mass[9] = 9 alert(mass.join(' ').trim().split(/\s+/).length)
mass.join("").length
var mass = []; mass[4] = 4 mass[9] = 9 mass[8] = 9000 alert(mass.join("").length);
var protomass = new Array protomass[1]=1 mass=[] mass.__proto__=protomass mass[4] = 4 mass[9] = 9 mass[8] = 9 console.log( mass.join().split(/\d+/).length - 1, Object.keys(mass).length, mass.join("").length ); //>>>> 4 3 4