Java script variables


#1


Im confused as to how variables work? and how to implement them? this is my first language, im not much of a coder, but as an IT engineer you got to have a hand in everything, If possible please explain as clearly as possible!

Thank you


https://www.codecademy.com/en/courses/getting-started-v2/4/1?curriculum_id=506324b3a7dffd00020bf661#


#2

Variables are quite easy to learn when you understand how they really work.

This is a variable,

my_name = "Any String"

How to create a variable is just by typing any word and an equal sign = but it must have a value that it stores whether a string, number or list.


#3

ok, im a little confused, in the Coarse it asks talks about
var variableName = ****
Do i not need the var?

and what does it actually do? just save a value for latter on ?


#4

No you don't need to include it, but for good practice and to help you understand the code you can include it. :slight_smile:


#5

Ok cool, and what does console.log() have to do with var aswell? does it just display the value?:


#6

console.log() is like the print statement in another programming languages. It has no relation to var. :grin:


#7

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