class Add {
constructor(...words) {
this.words = words;
}
print() {
var s = "$";
if (this.words.length > 0) {
this.words.map(w => {s += w + "$"});
} else {
s += "$";
}
console.log(s);
}
}
var x = new Add("hehe", "hoho", "haha", "hihi", "huhu");
var y = new Add("this", "is", "awesome");
var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", ",", "consectetur", "adipiscing", "elit");
var a = new Add();
x.print();
y.print();
z.print();
a.print();
Y2xhc3MgQWRkIHsKICBjb25zdHJ1Y3RvciguLi53b3JkcykgewogICAgICB0aGlzLndvcmRzID0gd29yZHM7CiAgfQogIAogIHByaW50KCkgewogICAgICB2YXIgcyA9ICIkIjsKICAgICAgaWYgKHRoaXMud29yZHMubGVuZ3RoID4gMCkgewogICAgICAgICAgdGhpcy53b3Jkcy5tYXAodyA9PiB7cyArPSB3ICsgIiQifSk7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgICBzICs9ICIkIjsKICAgICAgfQogICAgICBjb25zb2xlLmxvZyhzKTsKICB9Cn0KCnZhciB4ID0gbmV3IEFkZCgiaGVoZSIsICJob2hvIiwgImhhaGEiLCAiaGloaSIsICJodWh1Iik7CnZhciB5ID0gbmV3IEFkZCgidGhpcyIsICJpcyIsICJhd2Vzb21lIik7CnZhciB6ID0gbmV3IEFkZCgibG9yZW0iLCAiaXBzdW0iLCAiZG9sb3IiLCAic2l0IiwgImFtZXQiLCAiLCIsICJjb25zZWN0ZXR1ciIsICJhZGlwaXNjaW5nIiwgImVsaXQiKTsKdmFyIGEgPSBuZXcgQWRkKCk7CngucHJpbnQoKTsKeS5wcmludCgpOwp6LnByaW50KCk7CmEucHJpbnQoKTs=