Theme Layout

Boxed or Wide or Framed

Wide

Theme Translation

Display Featured Slider

Featured Slider Styles

Display Grid Slider

yes

Grid Slider Styles

Display Trending Posts

Display Author Bio

Display Instagram Footer

off

Dark or Light Style

Light

Blog Archive

Powered by Blogger.

Friday, February 10, 2017

[JavaScript] Variables


# JavaScript Variables


● JavaScript Identifiers.

  All JavaScript variables must be identified with unique names.
 These unique names are called identifiers.
 Identifiers can be short names or more descriptive names. 
 The general rules for constructing names for variables are:
  • Names can contain letters, digits, underscores, and dollar signs.
  • Names must begin with a letter
  • Names can also begin with $ and _ (but we will not use it in this tutorial)
  • Names are case sensitive (y and Y are different variables)
  • Reserved words (like JavaScript keywords) cannot be used as names

● JavaScript Data Types.

  JavaScript variables can hold numbers like 100 & text values like "Kevin".
  In Programming, text values are called text strings.
  Javascript can handle many types of data.
  Strings are written inside double or single quotes. Numbers are written without quotes.
  Below image is the example of JSP Data Types.

● JavaScript Arithmetic

  As with algebra, I can do arithmetic with JSP variables, using operators like = and +.
  Also, I can add strings, but strings will be concatenated. 
  When I put a number in quotes, the rest of the number will be treated as strings,
  and concatenated.


QuickEdit
Unknown
0 Comments
Share This Post :

You Might Also Like

No comments:

Post a Comment

Follow @SunriseSunsetBlog