In typescript code I have an array with objects in it. When I call \"getUsers(users)\" function, it returns the result as I need, but in console I get this error \"Uncaught Type
Your for loop exceeds the available array items. The heighest ID is users.length - 1.
So the easiest way is to remove the equal-sign.
Also think of using the buildt in forEach or map function like this:
function getUsers( users ) {
users.forEach( u => {
console.log( `${ u.firstName } is ${ u.age } years old!` );
} );
}