# Var myName issue

**URL:** <https://forum.freecodecamp.org/t/var-myname-issue/482453>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [October 20, 2021, 12:42pm UTC](https://forum.freecodecamp.org/t/var-myname-issue/482453 "2021-10-20T12:42:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dash88](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dash88](https://forum.freecodecamp.org/u/dash88)\
**Post date:** [October 20, 2021, 12:42pm UTC](https://forum.freecodecamp.org/t/var-myname-issue/482453/1 "2021-10-20T12:42:35Z")

</div>

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 :-

```auto
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:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/declare-javascript-variables)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![rio\_sanap](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rio_sanap/32/236783_2.png) [@rio\_sanap](https://forum.freecodecamp.org/u/rio_sanap)\
**Post date:** [October 20, 2021, 12:48pm UTC](https://forum.freecodecamp.org/t/var-myname-issue/482453/2 "2021-10-20T12:48:34Z")

</div>

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’;  
examples:  
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;

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [October 20, 2021, 1:02pm UTC](https://forum.freecodecamp.org/t/var-myname-issue/482453/3 "2021-10-20T13:02:22Z")

</div>

HI @dash88 !

Welcome to the forum!

> [@dash88](#):
>
> All the above doesn’t allow me to change, did I missed anything?

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.

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [October 20, 2021, 1:04pm UTC](https://forum.freecodecamp.org/t/var-myname-issue/482453/4 "2021-10-20T13:04:11Z")

</div>

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.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [April 21, 2022, 1:05am UTC](https://forum.freecodecamp.org/t/var-myname-issue/482453/5 "2022-04-21T01:05:03Z")

</div>

Closed on April 21, 2022, 1:05am UTC

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