Update README.md

always define your variables at the top. defining them elsewhere is confusing because of hoisting. there is no block scope in javascript.
This commit is contained in:
Jason Edelman
2013-11-08 11:06:43 -08:00
parent 95b6b5f6c9
commit cce1a2d3e0

View File

@@ -295,8 +295,9 @@
}
// good
var test;
if (currentUser) {
var test = function test() {
test = function test() {
console.log('Yup.');
};
}