JSFiddle - React, Tailwind, and code Playground
by QW01_01
JavaScript
class Test{
constructor(){
this.anybodyProperty = 0;
}
anybodyName() {
return new Promise(resolve => {
const onEvent = () => {
window.removeEventListener('resize', onEvent)
this.anybodyProperty = 1;
resolve(this);
}
window.addEventListener('resize', onEvent);
});
}
}
!async function (){
console.log(await (new Test().anybodyName()));
}()