You can write the printList
like this:
function printList<T>(items: (T & TWithParams)[], itemAccessor: (i: T & TWithParams) => string) {
items.forEach(i => {
if (!i.ignore) {
console.log(itemAccessor(i))
}
})
}
CLICK HERE to find out more related problems solutions.