It seems like there might be a simple solution that I'm overlooking, but the code below isn't functioning as expected when the currentRecord is found to be true.
How can I efficiently loop through an array and return the record when a match is found? I believe that AngularJS could be helpful in this scenario.
function getCurrentRecord() {
homePageVideos.forEach(function(rec) {
if (rec.currentRecord === true){
return rec;
}
});
}