==
and !=
JS-0050258
259
260function doAdjustment(id, title, amount, form, type){
261 if ((id==null) | (id ===""))return;262 db.collection(type).doc(id).set({
263 id: id,
264 title: title,
96
97 $('select#ptbtype').change(function(){
98 var selectedtype = $(this).children("option:selected").val();
99 if(selectedtype == 'liability'){100 $('.hide-for-liab').slideDown();
101 }else{
102 $('.hide-for-liab').slideUp();
87
88 $('select#ptbtype').change(function(){
89 var selectedtype = $(this).children("option:selected").val();
90 if(selectedtype == 'asset'){ 91 $('.hide-for-ass').slideDown();
92 }else{
93 $('.hide-for-ass').slideUp();
78
79 $('select#ptbtype').change(function(){
80 var selectedtype = $(this).children("option:selected").val();
81 if(selectedtype == 'expense'){ 82 $('.hide-for-exp').slideDown();
83 }else{
84 $('.hide-for-exp').slideUp();
54 $('.adjhide').hide();
55 $('.inad-area').slideDown();
56 }
57 else if(selectedAdj == 'baddebt'){ 58 $('.adjhide').hide();
59 $('.baddebt-area').slideDown();
60 }
It is considered good practice to use the type-safe equality operators ===
and !==
instead of their regular counterparts ==
and !=
.
The strict equality operators (===
and !==
) use the strict equality comparison algorithm to compare two operands.
false
.true
only if they refer to the same object.null
or both operands are undefined
, return true
.NaN
, return false
.+0
and -0
are considered to be the same value.true
or both false
.The most notable difference between this operator and the equality (==
) operator is that if the operands are of different types, the ==
operator attempts to convert them to the same type before comparing.
a == b
foo == true
bananas != 1
value == undefined
typeof foo == 'undefined'
'hello' != 'world'
0 == 0
true == true
foo == null
a === b
foo === true
bananas !== 1
value === undefined
typeof foo === 'undefined'
'hello' !== 'world'
0 === 0
true === true
foo === null