VarrienceLvl 25
Mellow possibly... not sure exactly what your trying to do, but i'll give 2 examples to try and answer what your trying to do, the
first is to add a property that keeps track of that in the object that will update manually, unlike arrays objects don't have a .prototype.length attribute
second is to encase multiple arrays of objects containing a Boolean on if they have been unlocked
the two examples will be showcased below for those who want to learnvar obj = { pro: true, noob: false, achivements: 1 total: 15 } // we can then update it at any time a new achievement is unlocked var loser = true; if(loser && !obj.noob){obj.noob = true; achivements++} console.log("you have "+obj.total-obj.achivements+" left keep it up!") // the second way is below here which is basically what Ack did var accomp = [ {title: "Ruiner", unlocked: false} {title: "Participation Award", unlocked: false} {title: "Secret Customer", unlocked: true} ]; // to calculate how many achievements we have left we must iterate through the Array function accompLeft(){ var left = accomp.length; // stores total achievements for(var i = 0; i < accomp.length; i++){ if(accomp[i].unlocked){left--} // here we access an accomp [ index ] and a .property from that index } return(left) }