Ben kodlu aşağıdadır:JSLint neden "typeof ... === 'undefined'" yerine "=== undefined" kullanmamı söylüyor?
showTitles = (typeof showTitles !== 'undefined') ? showTitles : 'Y';
showSelectGroup = (typeof showSelectGroup !== 'undefined') ? showSelectGroup : 'Y';
Ama JSLint söylüyor:
Warning 3 JS Lint: Unexpected 'typeof'. Use '===' to compare directly with undefined.
nasıl kodunu değiştirmek gerekir?
showTitles = (showTitles === undefined) ? 'Y' : showTitles;
showSelectGroup = (showSelectGroup === undefined) ? 'Y' : showSelectGroup;
jslint kullanarak Muhtemelen
Jslint hakkında hiçbir şey bilmiyorum, ama bence bunu yapmanı söylüyor: '(showtitles === undefined)'. – Travesty3
Mesajda şunları yazıyor: 'undefined' ile doğrudan karşılaştırmak için '===' kullanın. –
'Beklenmeyen 'typeof' sorunu değil,'! == 'değil. – Blazemonger