What are some examples where you would use var keyword instead of setting type upfront? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What are some examples where you would use var keyword instead of setting type upfront?

12th Jul 2016, 12:21 AM
Christian
Christian - avatar
2 Answers
7th Jan 2017, 5:31 AM
Ahmad Hamdan
Ahmad Hamdan - avatar
- 1
var number = 5; the console will figure out what data type it is when the code is ran.
15th Jul 2016, 5:44 PM
Deondre Prentice
Deondre Prentice - avatar