Math Object In TypeScript: Part 6
Before reading this article, please go through the following articles:
- asin(), acos() and atan() method in typescript
- atan2(), exp() and ceil() method in typescript
- floor(), log() and round() method in typescript
- sin(), cos() and tan() method in typescript
- pow(), sqrt() and random() method in typescript
Introduction
In this article, I am describing some of the TypeScript math functions.
max() Method
Syntax
- max(value1, value2, value3, value4........)
Function
- Max() {
- var span = document.createElement("span");
- span.style.color = "Blue";
- span.innerText = "Maximum number in given values is -> " + Math.max(5, 8, 12, 2, 15) + "\n";
- document.body.appendChild(span);
- }
min() Method
Syntax
- min(value1, value2, value3, value4........)
Function
- Min() {
- var span = document.createElement("span");
- span.style.color = "green";
- span.innerText = "Manimum number in given values is -> " + Math.min(5, 8, 12, 2, 15) + "\n";
- document.body.appendChild(span);
- }
Complete Program
Min_Max.ts


Join the conversation! Your thoughts help the community grow.