JSFiddle - React, Tailwind, and code Playground
JavaScript
function Constructor() {
this.value = 1;
this.showThis = function(val) {
document.write(val);
document.write(this);
}
}
const constr = new Constructor()
//Constructor.showThis('класс')
constr.showThis('объект <br/>');
function Constructor2() {
this.value = 1;
}
Constructor2.showThis = function(val) {
document.write(val);
document.write(this);
}
Constructor2.showThis('<br/>класс<br/>')
function showThis() {
document.write('<br/>функция<br/>');
document.write(this);
}
showThis()