Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81459 / js2html / testfile.js
diff options
context:
space:
mode:
Commitdea978cda53392281afae2ba57f9e310d8b395e7 (patch)
Author
 Vladimir Ananiev <vladeto97@gmail.com>
2018-10-25 14:34:19 +0300
Committer
 dtrendafilov <trendafilov.dn@gmail.com>
2018-10-25 14:34:19 +0300
Files563560b39df037405c9a296c74504698bb1c5737 /homework/81459/js2html/testfile.js
IPL-dea978cda53392281afae2ba57f9e310d8b395e7.tar
IPL-dea978cda53392281afae2ba57f9e310d8b395e7.tar.gz
IPL-dea978cda53392281afae2ba57f9e310d8b395e7.zip
Parentf5dc138f53ca4eb98063be5723785b79557e9cc3 (diff)
Homework 1 JavaScript highlighter in JavaScript (#14)
* Js2Html in Js * remove screenshot
1 files changed, 35 insertions, 0 deletions
-rw-r--r--homework/81459/js2html/testfile.js35
diff --git a/homework/81459/js2html/testfile.js b/homework/81459/js2html/testfile.js
new file mode 100644
index 0000000..0097012
--- /dev/null
+++ b/homework/81459/js2html/testfile.js
@@ -0,0 +1,35 @@
+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());
+ }
+})();
+
+