const element = document.querySelector("#box");
element.classList.contains("active");
document.body.classList.contains('my-class-name')
element.classList.contains(className);Code language: CSS (css)
export const isClass = <T>(value: unknown): value is Constructor<T> => {
return typeof value === "function" && typeof value.prototype === "object";
};
export type Constructor<T> = new (...args: unknown[]) => T;