There was an error while loading. Please reload this page.
1 parent 1ba0e18 commit 3c129f1Copy full SHA for 3c129f1
src/01-intro/07-modern.js
@@ -1,11 +1,17 @@
1
+// @ts-check
2
// Path: src/01-intro/07-modern.js
3
-/* Arrow function example */
4
+/**
5
+ * Arrow function example, calculates the area of a circle
6
+ * @param {number} radius
7
+ * @returns
8
+ */
9
const circleAreaFn = function circleArea(radius) {
10
const PI = 3.14;
11
const area = PI * radius * radius;
12
return area;
13
};
14
+// circleAreaFn('book');
15
console.log(circleAreaFn(2)); // 12.56
16
17
// refactoring to use arrow function
0 commit comments