mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 07:12:31 +03:00
Merge pull request #1537 from xtrasmal/patch-1
Updated javascript.html.markdown
This commit is contained in:
commit
8656cfe09f
@ -149,6 +149,10 @@ someOtherVar = 10;
|
|||||||
// Variables declared without being assigned to are set to undefined.
|
// Variables declared without being assigned to are set to undefined.
|
||||||
var someThirdVar; // = undefined
|
var someThirdVar; // = undefined
|
||||||
|
|
||||||
|
// if you wan't to declare a couple of variables, then you could use a comma
|
||||||
|
// separator
|
||||||
|
var someFourthVar = 2, someFifthVar = 4;
|
||||||
|
|
||||||
// There's shorthand for performing math operations on variables:
|
// There's shorthand for performing math operations on variables:
|
||||||
someVar += 5; // equivalent to someVar = someVar + 5; someVar is 10 now
|
someVar += 5; // equivalent to someVar = someVar + 5; someVar is 10 now
|
||||||
someVar *= 10; // now someVar is 100
|
someVar *= 10; // now someVar is 100
|
||||||
|
Loading…
Reference in New Issue
Block a user