Closed hanfengcan closed 5 years ago
thanks @hanfengcan
but the term item.vendorId && item.vendorId.toUpperCase()
doesn't make sense
I don't understand why. I have 2 virtual port which there have not vendorId.
the vendorId maybe undefined, so I try item.vendorId && item.vendorId.toUpperCase()
the expression
&&
is a boolean comparisonusing it together with strings mean something like "if item.vendorId exists AND item.vendorId.toUpperCase() exists". exists means "not null, not undefined"
includes((item.vendorId || '').toUpperCase())
should work
edit: sry...this construct should work in js....
yes, I tested the code. when the vendorId is undefined. the item.vendorId.toUpperCase()
will throw error.
this is why I used item.vendorId && item.vendorId.toUpperCase()
btw, code (item.vendorId || '').toUpperCase()
looks more elegant 😄
The includes() method is case sensitive.
fix the
No Connected Devices found | Total: 0
when the letter mismatchthe effect