==
and !=
JS-005013test("Checks mock themes to make sure the default one (defaultStyle) exists and is pipes.css", () => {
14 let styleName = "";
15 for(const style of styles) {
16 if(style.Filename == defaultStyle) {17 styleName = style.Name;
18 }
19 }
7 */
8function getCooldown(data: BoardsJSON, board: string, type: string) {
9 for(const boardData of data.boards) {
10 if(boardData.board != board) continue;11 return (boardData.cooldowns as any)[type];
12 }
13}
5 * @param $elem the jQuery element of the post
6 */
7export function isThreadLocked($elem: JQuery<HTMLElement>) {
8 return $elem.find("span.status-icons img.locked-icon").length == 1; 9}
10
11interface BoardLockJSON {
39 }).then((_data) => {
40 alert("Thread " + (lock?"locked":"unlocked") + " successfully");
41 const $lockOpt = $(`select#op${op} option`)
42 .filter((_i, el) => el.textContent == "Lock thread" || el.textContent == "Unlock thread");43 if(lock) {
44 $(`div#op${op} span.status-icons`).append(
45 $("<img/>").attr({
39 }).then((_data) => {
40 alert("Thread " + (lock?"locked":"unlocked") + " successfully");
41 const $lockOpt = $(`select#op${op} option`)
42 .filter((_i, el) => el.textContent == "Lock thread" || el.textContent == "Unlock thread");43 if(lock) {
44 $(`div#op${op} span.status-icons`).append(
45 $("<img/>").attr({
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