🐛 use ?? operator where suited instead of ||

This commit is contained in:
Jörn-Michael Miehe 2025-12-30 13:51:23 +00:00
parent 6a7491b15b
commit 1a865da656
2 changed files with 2 additions and 2 deletions

View file

@ -67,7 +67,7 @@ export class Rectangle {
}
public update(corner_1?: Vector2D, corner_2?: Vector2D): Rectangle {
return new Rectangle(corner_1 || this.corner_1, corner_2 || this.corner_2);
return new Rectangle(corner_1 ?? this.corner_1, corner_2 ?? this.corner_2);
}
public move(vector: Vector2D): Rectangle {

View file

@ -57,7 +57,7 @@ export const advent22Store = defineStore({
const favicon = await API.request<ImageData>("user/favicon");
const link: HTMLLinkElement =
document.querySelector("link[rel*='icon']") ||
document.querySelector("link[rel*='icon']") ??
document.createElement("link");
link.rel = "shortcut icon";
link.type = "image/x-icon";