From dea978cda53392281afae2ba57f9e310d8b395e7 Mon Sep 17 00:00:00 2001 From: Vladimir Ananiev Date: Thu, 25 Oct 2018 14:34:19 +0300 Subject: Homework 1 JavaScript highlighter in JavaScript (#14) * Js2Html in Js * remove screenshot --- homework/81459/js2html/output.html | 74 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 homework/81459/js2html/output.html (limited to 'homework/81459/js2html/output.html') diff --git a/homework/81459/js2html/output.html b/homework/81459/js2html/output.html new file mode 100644 index 0000000..52eeeb6 --- /dev/null +++ b/homework/81459/js2html/output.html @@ -0,0 +1,74 @@ + + + + + + +
+class Nonsense {
+   constructor() {
+      this.arbitraryArray = ['string with no meaning', 42];
+   }
+
+   doesThisMakeSense() {
+      return false;
+   }
+
+   answer(answer) {
+      console.log(answer);
+   }
+
+   whatIsTheMeaning() {
+      return this.arbitraryArray[this.getRandomIndex()]
+   }
+
+   getRandomIndex() {
+      return Math.floor(Math.random() * 2);
+   }
+}
+
+(function () {
+   console.log((-~function(){}-~function(){})); // 2, now that's weird
+   console.log(Array(16).join("lol" - 2) + " Batman!"); // ;)
+
+
+   const nonsense = new Nonsense();
+
+   while(nonsense.doesThisMakeSense()) { // No, it doesn't
+      nonsense.answer(nonsense.whatIsTheMeaning());
+   }
+})();
+
+
+
+        
+ + -- cgit v1.3.1-26-gb76a