Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/JavaScript
/ areaSquare
Function
areaSquare
Maths/Area.js:54–57 ·
view source on GitHub ↗
(side)
Source
from the content-addressed store, hash-verified
52
* @example areaSquare(4) = 16
53
*/
54
const
areaSquare = (side) => {
55
validateNumericParam(side,
'square side'
)
56
return
side ** 2
57
}
58
59
/**
60
* @
function
areaTriangle
Callers
nothing calls this directly
Calls
1
validateNumericParam
Function · 0.85
Tested by
no test coverage detected