Skip to content

Commit ee14d23

Browse files
committed
Updating readme
1 parent 080b6c6 commit ee14d23

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
# es6-cheatsheet
1+
# es6-cheatsheet
2+
3+
> A cheatsheet containing ES6 tips, tricks and code snippet examples for your day to day workflow. Contributions are welcome!
4+
5+
## var versus let / const
6+
7+
> Besides var, we now have access to two new identifiers for storing values - **let** and **const**. Unlike **var**, **let** and **const** statements are not hoisted to the top of their enclosing scope.
8+
9+
An example of using var:
10+
11+
```javascript
12+
var snack = 'Meow Mix';
13+
14+
function getFood(food) {
15+
if (food) {
16+
var snack = 'Friskies';
17+
return snack;
18+
}
19+
return snack;
20+
}
21+
22+
getFood(false); // undefined
23+
```

0 commit comments

Comments
 (0)