summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorXander Smalbil <xander@netbulae.eu>2015-10-15 22:38:44 +0200
committerXander Smalbil <xander@netbulae.eu>2015-10-15 22:38:44 +0200
commit841dcb5f0985f2b25a2d0b2285b03777cefd1a4f (patch)
tree12b0195d83c5b5784b00f694557f437c5fc9aefe
parent66bc42e31bf62a1592f9b763e12c0b963b3e7d3d (diff)
Updated javascript.html.markdown
Added some additional information on declaring variables.
-rw-r--r--javascript.html.markdown4
1 files changed, 4 insertions, 0 deletions
diff --git a/javascript.html.markdown b/javascript.html.markdown
index 6ea0b0bb..a8ca415e 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -144,6 +144,10 @@ someOtherVar = 10;
// Variables declared without being assigned to are set to 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:
someVar += 5; // equivalent to someVar = someVar + 5; someVar is 10 now
someVar *= 10; // now someVar is 100