File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,21 @@ const validateNumericParam = (param, paramName = 'param') => {
170
170
}
171
171
}
172
172
173
+ /**
174
+ * @function areaRectangleAlt
175
+ * @description An alternative method to calculate the area of a rectangle.
176
+ * @param {Integer } length - Integer
177
+ * @param {Integer } width - Integer
178
+ * @return {Integer } - length * width
179
+ * @example areaRectangleAlt(4, 5) = 20
180
+ */
181
+ const areaRectangleAlt = ( length , width ) => {
182
+ validateNumericParam ( length , 'Length' )
183
+ validateNumericParam ( width , 'Width' )
184
+ return length * width
185
+ }
186
+
187
+
173
188
export {
174
189
surfaceAreaCube ,
175
190
surfaceAreaSphere ,
@@ -180,5 +195,6 @@ export {
180
195
areaTrapezium ,
181
196
areaCircle ,
182
197
areaRhombus ,
183
- areaTriangleWithAllThreeSides
198
+ areaTriangleWithAllThreeSides ,
199
+ areaRectangleAlt
184
200
}
You can’t perform that action at this time.
0 commit comments