loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6358891419470345","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"Y2xhc3MgTGV0dGVyIHsKICBjb25zdHJ1Y3Rvcih2YWx1ZSkgeyAKICAgICAgICB0aGlzLnZhbHVlID0gdmFsdWU7CiAgICB9CiAgICAKICBpYW0oKSB7IAogICByZXR1cm4gYEkgYW0gdGhlICR7dGhpcy5jb25zdHJ1Y3Rvci5uYW1lfSAke3RoaXMudmFsdWV9YDsKICAgfQogICAKICBhbHBoYWJldCgpIHsgCiAgIHJldHVybiB0aGlzLnZhbHVlICsgIiBpcyBsZXR0ZXIgTm8uIiArICcwYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXonLmluZGV4T2YodGhpcy52YWx1ZSkgKyAiIGluIHRoZSBhbHBoYWJldCI7CiAgfQp9CgoKCmxldCB0ZXN0ID0gbmV3IExldHRlcigiYSIpOwpjb25zb2xlLmxvZyh0ZXN0LmlhbSgpKTsKY29uc29sZS5sb2codGVzdC5hbHBoYWJldCgpKTsKCmNsYXNzIFZvd2VsIGV4dGVuZHMgTGV0dGVyIHsKICBjb25zdHJ1Y3Rvcih2YWx1ZSkgeyAKICBzdXBlcih2YWx1ZSk7CiAgaWYgKFsiYSIsImUiLCJpIiwibyIsInUiXS5pbmRleE9mKHZhbHVlKSA9PT0gLTEpCiAgICAgICAgdGhyb3cgbmV3IFN5bnRheEVycm9yKCJJbnZhbGlkIHZvd2VsIik7CiAgfQp9CgoKbGV0IHRlc3QyID0gbmV3IFZvd2VsKCJpIik7CmNvbnNvbGUubG9nKHRlc3QyLmlhbSgpKTsKY29uc29sZS5sb2codGVzdDIuYWxwaGFiZXQoKSk7CgoKbGV0IHRlc3QzID0gbmV3IFZvd2VsKCJkIik7IC8vIFJhaXNlcyBzeW50YXggZXJyb3IgaW4gY29uc3RydWN0b3I="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class Letter {
  constructor(value) { 
        this.value = value;
    }
    
  iam() { 
   return `I am the ${this.constructor.name} ${this.value}`;
   }
   
  alphabet() { 
   return this.value + " is letter No." + '0abcdefghijklmnopqrstuvwxyz'.indexOf(this.value) + " in the alphabet";
  }
}



let test = new Letter("a");
console.log(test.iam());
console.log(test.alphabet());

class Vowel extends Letter {
  constructor(value) { 
  super(value);
  if (["a","e","i","o","u"].indexOf(value) === -1)
        throw new SyntaxError("Invalid vowel");
  }
}


let test2 = new Vowel("i");
console.log(test2.iam());
console.log(test2.alphabet());


let test3 = new Vowel("d"); // Raises syntax error in constructor
Native Browser JavaScript