Skip to content

Commit 2435daa

Browse files
committed
Use Arrow Function to Write Concise Anonymous Functions
1 parent 8846384 commit 2435daa

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,4 +1080,17 @@ function freezeObj() {
10801080
}
10811081

10821082
const PI = freezeObj();
1083-
console.log(PI);
1083+
console.log(PI);
1084+
1085+
/**Use Arrow Function to Write Concise Anonymous Functions **/
1086+
//function(){} anonymous function you can convert to => function
1087+
// var magic = function() {
1088+
// return new Date();
1089+
// }
1090+
//ex:
1091+
// var magic = () => {
1092+
// return new Date();
1093+
// };
1094+
1095+
// more simple
1096+
var magic = () => new Date();

0 commit comments

Comments
 (0)