we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to assign value to variable"
Valerio
01 Mar 2017
1//In Javascript, to assign any value to a variable, type:
2// var (name of variable) '=' (value)
3//For example:
4var num = 6;
5print (num);
6//output will be: 6.
7//Don't forget to upvote this answer if it was helpful!