+ 1
You are making a text encryptor. It should take multiple words and output a combined version, where each word is separated by a
Using JavaScript
10 ответов
+ 3
Please tag "Javascript", not "words".
What have you tried so far? Please show your code attempt. If you can't come up with an attempt, read the previous lesson again.
+ 1
Google - btoa atob in Javascript
And you will get the answer
+ 1
Use btoa atob method which uses base64 encryption
Just google btoa atob in js
+ 1
Code Infinite with Arnav The code refers to a task in the sololearn Javascript course.
Samuel Michael Ayodeji Please read the previous lesson again: You need to make a new ⭐method⭐ for the Add class – not a function.
Also please check the spelling, it is "var", not "Var" and so forth. In the else-part a "+" is missing.
0
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
Print(){
Var y ="";
For(x of this.words){
if(x ==","){
x = "";
}
else{
y + ="quot;var+x;
}
}
y =y+"quot;;
console.log(y);
}
}
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");
x.print();
y.print();
z.print();
0
Which line of the code will I place the JavaScript answer.
0
I understand,
Thanks for the heads up .
0
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
print() {
const t = '#x27; + this.words + '#x27;;
console.log(t)
}
}
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");
x.print();
y.print();
z.print();
0
I finally solved it here below
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
print() {
const t = '#x27; + this.words.join('#x27;) + '#x27;;
console.log(t);
}
}
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");
x.print();
y.print();
z.print();