can anyone help to define the error in this code:
function logMatches() {
var matches = ['Paulson', 'Sarah', 'Jad', 'Joanna'];
for (var i=0; i<matches.length; i++) {
setTimeout(function() {
console.log(matches[i]);
}, 1000);
}
}