I am encountering an issue where the Method is not reading the values in the arguments, despite my attempts to pass each argument through the constructor into the method for encryption. Could someone please point out what I might be doing wrong?
class Add {
constructor(...words) {
this.words = words;
}
print(words){
words = [words];
let output = "$"
console.log(words)
for(let word of words){
output += word +"$"
}
return output
}
}
var x = new Add("I", "Love","you");
var y = new Add("this", "is", "awesome");
x.print()
z.print()