From cdf12588313afc6ccc981375a06781ee4a3c22f9 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Wed, 31 Jan 2024 20:33:46 -0500 Subject: [PATCH] added thisthat --- thisthat/index.html | 20 ++++++++++++++++++++ thisthat/main.js | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 thisthat/index.html create mode 100644 thisthat/main.js 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