Use === in JS

This commit is contained in:
Alexandre Iooss 2020-09-05 08:38:31 +02:00
parent bad5fe3c22
commit afc367cfb8
2 changed files with 6 additions and 6 deletions

View File

@ -39,16 +39,16 @@
}
var showAddButton = function () {
return maxForms.length == 0 || // For Django versions pre 1.2
(maxForms.val() == '' || (maxForms.val() - totalForms.val() > 0))
return maxForms.length === 0 || // For Django versions pre 1.2
(maxForms.val() === '' || (maxForms.val() - totalForms.val() > 0))
}
/**
* Indicates whether delete link(s) can be displayed - when total forms > min forms
*/
var showDeleteLinks = function () {
return minForms.length == 0 || // For Django versions pre 1.7
(minForms.val() == '' || (totalForms.val() - minForms.val() > 0))
return minForms.length === 0 || // For Django versions pre 1.7
(minForms.val() === '' || (totalForms.val() - minForms.val() > 0))
}
var insertDeleteLink = function (row) {

View File

@ -38,8 +38,8 @@ function afterKonami () {
// Register custom event
document.addEventListener('keydown', (e) => {
cursor = (e.keyCode == KONAMI_CODE[cursor]) ? cursor + 1 : 0
if (cursor == KONAMI_CODE.length) {
cursor = (e.keyCode === KONAMI_CODE[cursor]) ? cursor + 1 : 0
if (cursor === KONAMI_CODE.length) {
afterKonami()
}
})