Var myName issue

Hey guys,

I’m total new & dummy to this whole coding and I’m excited to learn more about it however, I can’t even pass the 2nd test which requires me to var myName; i have follow the steps and still say I didn’t do it the right way.

What is the right way to variable myName?

I have tried :-

var myName = "ash";
var myName;
var myName = "ash123";

All the above doesn’t allow me to change, did I missed anything?

Your code so far

Your browser information:

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

Challenge: Declare JavaScript Variables

Link to the challenge:

syntax for declaring variable are
1st way : using var keyword;
var variableName = 'value of variable;
examples :
var name = ‘rio’;
var age = 19;
var developer = true;

2nd way ; using let keyword
let variableName = ‘value of variable’;
let name = ‘rio’;
let age = 19;
let developer = true;

3rd way using const keyword:
const variableName = ‘variable value’;
examples :
const name = ‘rio’;
const age = 19;
const coder = true;

HI @dash88 !

Welcome to the forum!

But one of those is the correct answer.
Your answer should on be one line of code.
Not three.

The lesson wants you to just declare the variable not assign a value to it.

Try again with just the variable declaration.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.