Third, the variables brief

A variable concept:

Second variable declaration:

Three of uninitialized variables default:

IV. If the specified variable type is automatically infer data types at compile time, unlike a dynamically typed language, while the program is running is to know what type of data

 

 Shorter variables declaratively (initialize declare local variables, use only the body of the function, if you want to declare variables in a function in vitro, or be declared with the var keyword)    Note: Global and local variables do not conflict (as variable names)

    If multiple variables are declared, there is at least declare a new variable, then the other, even if no error will be declared, will be reassigned

 

 

Five anonymous variables (scenarios: used for function return values)

  For example, the function has multiple return values, but I only want one or a few of which, you can put other variables become anonymous variable

 

 Six multi-variable assignment (receipt shortcut key: alt + shift + ↑ or ↓) allows the cursor line of code with other lines of code to change location

  Direct exchange variable values

 

Guess you like

Origin www.cnblogs.com/youantianqin/p/11100353.html