Skip to content
This repository was archived by the owner on Oct 7, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions j8Jgw3/XgxUIi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Function to calculate the area of an equilateral triangle
function equilateralTriangleArea(sideLength) {
return (sideLength * sideLength * Math.sqrt(3)) / 4;
}

// Example usage:
const sideLength = 5; // Replace with your desired side length
const area = equilateralTriangleArea(sideLength);
console.log(`The area of the equilateral triangle is ${area}`);