0
what's the purpose of a variable?
9 Réponses
+ 6
simply its useful to store data
+ 3
variable used for storing the data.....which may be varry or changed by the programmer during programme execution time. ..like... int a=3; and then a=7; so 3,7 are constant bcz it's fixed but value of( a)is being varry so it is a variable...
+ 2
To store data.
+ 2
A few examples:
var a = 42; //number
var b = "some text"; //string
var c = true; //boolean
var d = ["a", "b", "c"]; //array
+ 2
variable are memory location that can be used for storing data
for eg 'var name' will store someones name
+ 1
could you give me an example please?
+ 1
like what kinda data?
0
any data, but each variable only able to contain one data or value
0
To hold information like:
var name = prompt("What is your name");