You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure the type check (typeof isCrushed.name === 'string') is necessary here:
if (
process.env.NODE_ENV !== 'production' &&
typeof isCrushed.name === 'string' &&
isCrushed.name !== 'isCrushed'
) {
console.log('You are currently using minified code outside of NODE_ENV === \'production\'.')
}
By using the strict not-equals (!==) in the next check, we are guaranteeing that isCrushed.name has the same type as 'isCrushed', which is a string. Therefore the explicit type check is unnecessary.
The text was updated successfully, but these errors were encountered:
Hi @gunar,
I'm not sure the type check (
typeof isCrushed.name === 'string'
) is necessary here:By using the strict not-equals (
!==
) in the next check, we are guaranteeing thatisCrushed.name
has the same type as'isCrushed'
, which is a string. Therefore the explicit type check is unnecessary.The text was updated successfully, but these errors were encountered: