Object Key is returning "undefined"

I am currently working on the JS cash register assignment and I have come into a problem with accessing an object. I can see the value store in denomForChange.val in the console, but in my program it results in undefined and thus cannot be accessed. Can someone help me understand what is happening and how I may fix it?

Register is an object that has name, amount, and val keys. My code can be seen at: CashRegisterCode

const denomForChange = register.reverse().filter(function(el) {
            return (el.val <= change && el.amount > 0);
        })[0];
        
        change -= denomForChange.val;