0👍
I think the problem is coming from here:
item.type !== 'hat' || item.type !== 'glases'
- This always returns
true
becauseitem.type
will never be equivalent to'hat'
and'glases'
at the same time. - I doubt that
'glases'
is a correct spelling? This might be a problem or just a mis-typing
Source:stackexchange.com