diff --git a/thisthat/index.html b/thisthat/index.html new file mode 100644 index 0000000..9c4e595 --- /dev/null +++ b/thisthat/index.html @@ -0,0 +1,20 @@ + + + + + + + Document + + + + + + + + + + + + \ No newline at end of file diff --git a/thisthat/main.js b/thisthat/main.js new file mode 100644 index 0000000..62b8954 --- /dev/null +++ b/thisthat/main.js @@ -0,0 +1,40 @@ + +class FatBoom{ + word(){ + return "boom de fat classe"; + } + + boom = (evt) => { + alert(this.word()) + } +} + +class Boom{ + word(){ + return "boom de classe"; + } + + boom(evt){ + alert(this.word()) + } +} + +function boom(){ + alert("hello world") +} + +const fatBoom = () => { + alert("HELLO WORLD") +} + +document.getElementById("button") + .addEventListener("click", boom) + +document.getElementById("button1") + .addEventListener("click", fatBoom) + +document.getElementById("button2") + .addEventListener("click", (new Boom()).boom) + +document.getElementById("button3") + .addEventListener("click", (new FatBoom()).boom) \ No newline at end of file