Find the bug in this helper, which promises to return the current decision at the end of any supersession chain.
JavaScript
function currentDecision(records, id) {
const record = records.get(id);
if (record.status === 'Superseded') {
return records.get(record.replacement);
}
return record;
}