- local variable
- global variable.
- Name start with a letter (a to z or A to Z), and underscore( _ ), or dollar( $ ) sign.
- After first letter we can also use digits (0 to 9), (for example value1)
<html> <body> <script> var x = 50; var y = "prasant"; var z=x+y; document.write(z); </script> </body> </html>
Local variables : Variables that exist only inside a function are called Local variables. They have no presence outside the function. The values of such Local variables cannot be changed by the main code or other functions.
200 400 500 sum of numbers is:1100