Answered
Do multiple parallel items after '===' have to be listed separately for each item?
For example, I always want to write multiple conditions like this:
if(('Rectangle' || 'Oval' || 'Polygon') == item.constructor.name)But I found that it only recognizes the first one, or it feels a bit slow to run.
Does it have to be written like this? There is still a better way to write it:
if(
'Rectangle' === item.constructor.name
|| 'Oval'=== item.constructor.name
|| 'Polygon'=== item.constructor.name
)
