Variables help

Hi guys,
I have a doubt in this lesson of variables of yours.I am a newbie so pls, do understand me.
In this example what is the difference between this
var = "50,000"
and this

var = 50,000 

and why is the latter an error.
Is it that commas are only allowed in a string when declaring it.


Hi @hari123456789,

Can you post a link to your exercise so we can have a look?

In your case, I think you’ve been missing a variable name?

var ???= “50,000”;

Let’s say you have given it a name:

var myLuckyNumber = "50,000";

The “50,000” is a string value. Just like a text, it does not contain numerical value.


if you write it this way:

var myLuckyNumber = 50000;

The 50000 is a number type data. It contains numerical value. You can have mathematical operation with it. Just don’t put comma in between, just numbers, simply because commas aren’t numbers.

Hope this helps :slight_smile:


Hi @codexthon ,
This doubt just popped of from my mind so, i couldn’t give you the exact part of the lesson.But thanks for your quick response and for making me understand.:grinning:

1 Like

You’re welcomed. Cheers! :smiley:

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