0

what's the purpose of a variable?

1st Sep 2016, 6:58 PM
Casey
Casey - avatar
9 Respostas
+ 6
simply its useful to store data
2nd Sep 2016, 7:20 PM
Henil Mamaniya
Henil Mamaniya - avatar
+ 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...
2nd Sep 2016, 3:48 AM
Ankita
+ 2
To store data.
1st Sep 2016, 8:11 PM
Zen
Zen - avatar
+ 2
A few examples: var a = 42; //number var b = "some text"; //string var c = true; //boolean var d = ["a", "b", "c"]; //array
2nd Sep 2016, 9:05 AM
Zen
Zen - avatar
+ 2
variable are memory location that can be used for storing data for eg 'var name' will store someones name
25th Oct 2016, 8:14 AM
priyam chopra
priyam chopra - avatar
+ 1
could you give me an example please?
1st Sep 2016, 10:43 PM
Casey
Casey - avatar
+ 1
like what kinda data?
1st Sep 2016, 10:43 PM
Casey
Casey - avatar
0
any data, but each variable only able to contain one data or value
3rd Sep 2016, 7:31 AM
dzoel
dzoel - avatar
0
To hold information like: var name = prompt("What is your name");
30th Sep 2016, 1:31 PM
Trey