Only the available phones
Take your time, follow the code and check your understanding.
The codeArrays
const phones = [{model:"A",inStock:true},{model:"B",inStock:false}];
console.log(phones.filter(p => p.inStock).map(p => p.model));Your answer3 min · no timer
Show solution and explanation
filter keeps only records where the callback is true. map then extracts each retained model.
["A"]