How to write a for loop with a return?

Good day!
Question in the code comments, I think it's more convenient.
computed: {
 loadingClass () {
 return this.downloadingVideo ? 'load-icon_loading' : "
},
 videoList () {
// get an array of objects. Each object has a field "status"
 return this.$store.state.video.common 
},
 downloadingVideo () {
// here is the main problem. The idea is simple: I want to scroll through an array of objects 
// and in each of them to check what value the field "status", 
// but iteration to happen only once, for obvious reasons, and return'. 
// Prompt the correct implementation of the idea, please. 
 for (let i = 0; i < this.videoList.length; i++) {
 return this.videoList[i].status === 'done' ? false : true
}
}
 }
April 4th 20 at 13:29
3 answers
April 4th 20 at 13:31
Solution
April 4th 20 at 13:33
Solution
return this.videoList.filter ( v => {
 return v.status === 'done' ? false : true;
})
this.videoList.filter( v => v.status !== 'done') - iva commented on April 4th 20 at 13:36
April 4th 20 at 13:35
return this.videoList.map(v -> v.status === 'done' ? false : true)

Find more questions by tags JavaScriptVue.js