Back to Freecodecamp

Step 11

curriculum/challenges/english/blocks/learn-introductory-javascript-by-building-a-pyramid-generator/6610b9f7619764fad5fd516d.md

latest1.1 KB
Original Source

--description--

You can also assign the value of a variable to another variable. For example:

js
let first = "One";
let second = "Two";
second = first;

The second variable would now have the value "One".

To see this in action, change your secondCharacter assignment from "Test" to your character variable.

Then open the console to see what gets logged.

--hints--

You should not assign the value "Test" to your secondCharacter variable.

js
assert.notEqual(secondCharacter, "Test");

You should assign the value of the character variable to your secondCharacter variable. Don't forget your semicolon.

js
assert.match(__helpers.removeJSComments(code), /secondCharacter\s*=\s*character;/);

Your secondCharacter variable should now have the value "World".

js
assert.equal(secondCharacter, "World");

--seed--

--seed-contents--

js
let character = 'Hello';
console.log(character);
character = "World";
let secondCharacter;
--fcc-editable-region--
secondCharacter = "Test";
--fcc-editable-region--
console.log(secondCharacter);