Tell us what’s happening:
JavaScript Algorithms and Data Structures (Beta)
step 11
I couldn’t solve this exercise. How can I solve this exercise.
If someone know how to solve this exercise please tell me.
Your code so far
let character = 'hello';
console.log(character);
character = "one";
let secondCharacter = "hello";
// User Editable Region
secondCharacter = "world";
// User Editable Region
console.log(secondCharacter);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 11
Hi @Shocean,
The instructions want us to change our secondCharacter
assignment from "Test"
to our character
variable. So we just want to set one variable’s value for a different variable’s value.
To set one variable’s value to a different variable’s value we would use the assignment operator (=
). So it would look like the following:
let data1 = 'cat';
let data2 = 'dog';
// Now I want data2 to have the value of data1
data2 = data1; // data2's value is now 'cat'
I hope this helps. Happy coding!
Hi adlairmorris.
Thank you so much answered me
let first = sho
let second = world
world = sho;
I tried this coding but it was still incorrect.
Where was I wrong that?
Thank you.[quote=“ablairmorris, post:2, topic:703154, full:true”]
Hi @Shocean,
The instructions want us to change our secondCharacter
assignment from "Test"
to our character
variable. So we just want to set one variable’s value for a different variable’s value.
To set one variable’s value to a different variable’s value we would use the assignment operator (=
). So it would look like the following:
let data1 = 'cat';
let data2 = 'dog';
// Now I want data2 to have the value of data1
data2 = data1; // data2's value is now 'cat'
I hope this helps. Happy coding!
[/quote]
I have done now.
Thank you so much supported me.
I really appreciated.
1 Like