wilfredinni/javascript-cheatsheet

Add Math Objects.

i-am-SnehaChauhan opened this issue · 1 comments

Issue: Enhancement - Add JavaScript Math Object Methods to Cheatsheet

Description:
The current JavaScript cheatsheet is a valuable resource, but it's missing essential information regarding the JavaScript Math object and its methods. This issue proposes adding essential Math object methods to enhance the cheatsheet's completeness and usefulness.

JavaScript Math Object Methods to Add:

  1. Math.sin(x): Returns the sine of x.
  2. Math.cos(x): Returns the cosine of x.
  3. Math.tan(x): Returns the tangent of x.
  4. Math.random(): Returns a pseudo-random number between 0 and 1.
  5. Math.round(x): Rounds a number to the nearest integer.
  6. Math.max(x, y, ...): Returns the largest of zero or more numbers.
  7. Math.min(x, y, ...): Returns the smallest of zero or more numbers.
  8. Math.abs(x): Returns the absolute value of x.

Benefits:

  • Inclusion of these methods will provide a comprehensive overview of the JavaScript Math object.
  • Users consulting the cheatsheet will have a quick reference for common mathematical operations.

Example Usage:

const angle = Math.PI / 4;
const sineValue = Math.sin(angle);
console.log(`The sine of ${angle} is ${sineValue}`);

Please assign this to me under hacktoberfest.