Learn Introductory JavaScript by Building a Pyramid Generator - Step 1

Tell us what’s happening:

You should use let to declare a character variable.

Your code so far


// User Editable Region

let myChar = 'a';
let firstLetter = 'C'; // Declares a variable named firstLetter with the character 'C'
console.log(firstLetter); // Output: C

// Using let to declare multiple character variables
let char1 = 'X', char2 = 'Y', char3 = 'Z';
console.log(char1, char2, char3); // Output: X Y Z

// Using let in a block scope with characters
{
  let char = 'B';
  console.log(char); // Output: B
}

// Redefining a character variable in a different block scope
let char = 'A';
{
  let char = 'D'; // This is a different variable 'char' with block scope
  console.log(char); // Output: D
}
console.log(char); // Output: A, because this is the outer variable 'char'


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 1

You have a lot of code here but I don’t see a character variable.