Skip to content

Commit 3c129f1

Browse files
committed
Refactor code in src/01-intro/07-modern.js to use arrow function and add JSDoc comments
1 parent 1ba0e18 commit 3c129f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/01-intro/07-modern.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
// @ts-check
12
// Path: src/01-intro/07-modern.js
23

3-
/* Arrow function example */
4+
/**
5+
* Arrow function example, calculates the area of a circle
6+
* @param {number} radius
7+
* @returns
8+
*/
49
const circleAreaFn = function circleArea(radius) {
510
const PI = 3.14;
611
const area = PI * radius * radius;
712
return area;
813
};
14+
// circleAreaFn('book');
915
console.log(circleAreaFn(2)); // 12.56
1016

1117
// refactoring to use arrow function

0 commit comments

Comments
 (0)