I confuse in this topic!


#1

when i am writing within quotes like this "junk".......var junk=["sss","ooo",333,123];
console.log("junk")
its showing on output screen like this.
junk<-------------- output
when i dont use quotes, it is giving the data like this
[ 'sss', 'ooo', 333, 123 ] output screen value


#2

I will explain this to you:

If something is given in quotes that means it is a string. So if you type to console.log something within quotes it will print what is written inside quotes.

The next case, without quotes:

If you have typed "var junk=["sss","ooo",333,123];", it means that you have created an array which holds the values given inside square brackets. This means that the word junk holds the values given inside the brackets. So if you type junk without quotes you are referring to the values inside square brackets.

HOPE YOU UNDERSTOOD :smile::blush:

If you are thinking what'll happen if you don't type in "var junk=["sss","ooo",333,123];", then it'll produce an error that junk is not defined(if you are console.logging 'junk' without quotes)

TELL ME IF YOU DON'T UNDERSTAND:blush::smiley:


#3

i got it :smiley: :smile: