From 98e992017d99d0122fa5a2a38c3bb155d98de5dc Mon Sep 17 00:00:00 2001 From: DrxcoDev <156522801+DrxcoDev@users.noreply.github.com> Date: Fri, 26 Jan 2024 18:01:19 +0100 Subject: [PATCH] Update Area.js --- Maths/Area.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Maths/Area.js b/Maths/Area.js index a047b92223..0b748fd722 100644 --- a/Maths/Area.js +++ b/Maths/Area.js @@ -170,6 +170,21 @@ const validateNumericParam = (param, paramName = 'param') => { } } +/** + * @function areaRectangleAlt + * @description An alternative method to calculate the area of a rectangle. + * @param {Integer} length - Integer + * @param {Integer} width - Integer + * @return {Integer} - length * width + * @example areaRectangleAlt(4, 5) = 20 + */ +const areaRectangleAlt = (length, width) => { + validateNumericParam(length, 'Length') + validateNumericParam(width, 'Width') + return length * width +} + + export { surfaceAreaCube, surfaceAreaSphere, @@ -180,5 +195,6 @@ export { areaTrapezium, areaCircle, areaRhombus, - areaTriangleWithAllThreeSides + areaTriangleWithAllThreeSides, + areaRectangleAlt } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy