Mellow well did you format it properly? the way Ack show it is object array and i'll give a smaller demo of what he did that way it should be followable
// This is a DEMO please read comments if your stuck or confused
var accomp = [
{
title: "new world", // a title of the achivement optional properties like description can also be added
unlocked: true // the property to look for if we unlocked the achivement
}, // , <= is important since this is an array
{
title: "pro",
unlocked: false
},
{
title: "gamer",
unlocked: true
}
];
// here we are going to count how many achivements we have left
console.log(accomp.length) // <= this will give us how many achivements we have
var unlocked = 0; // keeps track of the current achivements we have
for (var a = 0; a < accomp.length; a++) { // here we iterate through the array
if (accomp[a].unlocked === true) { // === true doesn't need to be there if's already look for a boolean outcome
unlocked += 1; // we add here how many is unlocked
}
}
// here is something more complex we know how many achivements we unlocked and how many we have,
// but how do we show that as output since "-" statements are illegal in console.log statements
var achivementsLeft = accomp.length - unlocked; // this makes it so no () are needed
console.log("You have " + unlocked + " achivements so far\n There's " + achivementsLeft + " left go get em champ")
// this is how it would be done given that you didn't want to declare a variable for a result
console.log("You have " + unlocked + " achivements so far\n There's " + (accomp.length - unlocked) + " left go get em champ")