Tell us what’s happening:
How best to improve my Javascript skills?
Your code so far
let character = "Hello";
// User Editable Region
let profession = "teacher";
profession = "age";
log.console(profession);
// 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/126.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 13
Thanks, what’s missing here can you show me an example of valuating the “teacher” variable?
There is no ‘teacher’ variable?
You should have two new variables, ‘profession’ and ‘age’. Currently you only have one variable - ‘profession’
instructions:
Use the let keyword to declare a profession variable and an age variable. Initialize profession with the string "teacher", but do not initialize age with any value.
you missed two things to do, the istruction asking for.
How does this look?
let profession = “teacher”;
let profession = “age”;
let profession = ‘teacher’;
let profession = ‘age’;
log.console(profession);Preformatted text
this looks well. but it is not according to the instructions.
You now have 4 variables all called ‘profession’. You have 0 called age. And, you cannot re-declare variables like that
How this?
let profession = “teacher”;
let profession = “age”;
let age = ‘teacher’;
let age = ‘’;
log.console(profession);
> Blockquote
let profession = “teacher”;
let profession = “age”;
let age = ‘teacher’;
let age = ‘’;
log.console(profession);Preformatted text
You now have ‘profession’ twice and ‘age’ twice. You must only declare each of those once
Maybe you should start from here . This will give you a basis understanding about naming and assigning Variable.
above line is correct.
anon42410019:
let profession = “age”;
that is not required.
anon42410019:
let age = ‘teacher’;
don not assign any value to the variable age.
anon42410019:
let age = ‘’;
that is not required.
anon42410019:
log.console(profession);
that is correct.
and you have missing printing the age variable.
How’s this?
console.log(profession);
let profession = “teacher”;
console.log(age);
let profession = “age”;Preformatted text
anon42410019:
console.log(profession);
this is correct but you added it on top. move it below the variable assignments and diclairation.
this line is correct.
anon42410019:
console.log(age);
this is correct.
anon42410019:
let profession = “age”;
remove this.
after this declaire age
variable with `let keyword.
example:
let variable;
Like this?
let variable = new Date;Preformatted text
*let variable = “new Date”;
anon42410019:
let variable = new Date;
seriously, tell me you are not kidding with me.
hasanzaib1389:
example:
let variable;
above is the example, you need to follow the example to do, what is asking in the instructions of challenge step.
1 Like
Coding involves simple and hard tasks if there were solutions on the platform as an assurance kind of thing then I wouldn’t be struggling would I? I do add the punctuation in there as part of fixing bugs in my coding.
You should ask more simple and straightforward questions about what to do.
For example: “How do I declare a variable?”
“How do I delcare a variable without assigning a value?”
Read the instructions and try to think through it logically. The lines are sequential. Would you print a variable before creating it?