Skip to content

Commit ac93e83

Browse files
rmurpheygnarf
authored andcommitted
remove var def article in perf section (fixes jquery#256)
adds related content to syntax basics
1 parent fdbd76c commit ac93e83

File tree

3 files changed

+25
-31
lines changed

3 files changed

+25
-31
lines changed

order.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
- dont-act-on-absent-elements
8080
- optimize-selectors
8181
- use-stylesheets-for-changing-css
82-
- variable-definition
8382
- read-the-source
8483
- code-organization:
8584
- concepts

page/javascript-101/syntax-basics.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Syntax Basics
33
level: beginner
44
source: http://jqfundamentals.com/legacy
5-
attribution:
5+
attribution:
66
- jQuery Fundamentals
77
---
88

@@ -75,3 +75,27 @@ var $my_AwesomeVariable = "d";
7575
var _my_awesome_variable_$ = "e";
7676
```
7777

78+
### Variable definition
79+
80+
Variables can be defined using multiple `var` statements, or in a single
81+
combined var statement.
82+
83+
```
84+
// this works
85+
var test = 1;
86+
var test2 = function() { ... };
87+
var test3 = test2( test );
88+
89+
// and so does this
90+
var test4 = 1,
91+
test5 = function() { ... },
92+
test6 = test2( test );
93+
```
94+
95+
Variables can be declared without assigning them a value. The value of a
96+
variable declared without a value is `undefined`.
97+
98+
```
99+
var x;
100+
x === undefined; // true
101+
```

page/performance/variable-definition.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)