Skip to content

Commit de0c437

Browse files
committed
Updated arrow.js - ES5 uses vars
1 parent 6093a43 commit de0c437

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arrow.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let foo = ["Hello", "World"];
1010
let bar = foo.map(x => x.length);
1111

1212
// ES5
13-
let bar = foo.map(function(x) { return x.length; });
13+
var bar = foo.map(function(x) { return x.length; });
1414

1515
//multiline functions require curly braces
1616
//no arguments expect parenthesis
@@ -20,15 +20,15 @@ let foobar = () => {
2020
};
2121

2222
// ES5
23-
let foobar = function() {
23+
var foobar = function() {
2424
console.log("Hello");
2525
console.log("World");
2626
}
2727

28-
//Returning onbject literal
28+
//Returning onbject literal. Requires Brackets.
2929
let quux = () => ({ "myProp" : 123 });
3030

3131
//ES5
32-
let quux = function() {
32+
var quux = function() {
3333
return { "myProp" : 123 };
3434
};

0 commit comments

Comments
 (0)