0% found this document useful (0 votes)
5 views

JavaScript Variable

Uploaded by

antei kuwute
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

JavaScript Variable

Uploaded by

antei kuwute
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

JavaScript Variable

var myName = "Aram"; /* var as a keyword and myName as avariable name and then = "Aram" as a
value;*/

var yourName = prompt("What is Your Name?"); /* The variable value is created or imported from
anything that we inserted on the prompt */

console.log(yourName); /* and when we console.log the variable, it'll show the value that we
inserted on the prompt */

/* now if we try to make an alert like a welcome message it will be like this: */

alert("Hello, my name is " + myName + ", and welcome to my page " + yourName + "!"); /* if you're
typing a text, then use string with the "". but if you want to call a variable, you just need the name of
that variable you wanted to call */

/* for information, you can't name variable that begin with a number typed first, it must an alphabet
at first. Example : var a1 = "value"; and also no space in naming variable, ONLY: alphabet, numeric,
and undercore (a1_)*/

You might also like