==
and !=
JS-0050 4import "jquery-ui/ui/keycode";
5import "jquery-ui/ui/widgets/tabs";
6$(() => {
7 if(window.location.pathname != webroot + "manage/filebans") 8 return;
9 $("div#fileban-tabs").tabs();
10});
239 quoted +
240 msgbox.value.slice(cursor);
241
242 if(msgbox.id == "postmsg")243 window.scroll(0,msgbox.offsetTop - 48);
244 msgbox.focus();
245}
234 }
235 let cursor = (msgbox.selectionStart !== undefined)?msgbox.selectionStart:msgbox.value.length;
236 let quoted = lines.join("\n");
237 if(quoted != "") quoted += "\n";238 msgbox.value = msgbox.value.slice(0, cursor) + `>>${no}\n` +
239 quoted +
240 msgbox.value.slice(cursor);
134}
135
136export function initPostPreviews($post = null) {
137 if(getPageThread().board == "" && $post === null) return;138 doClickPreview = getBooleanStorageVal("enablepostclick", true);
139 doHoverPreview = getBooleanStorageVal("enableposthover", false);
140 let $refs = null;
121 }
122 return;
123 }
124 if(e.type == "click") {125 $.get(href, data => {
126 $post = $(data).find(`div#op${postID}, div#reply${postID}`).first();
127 if($post.length < 1) return; // post not on this page.
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