• Skip to main content
  • Skip to search
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Technologie Internetowe dla developerów
  2. JavaScript
  3. Dokumentacja referencyjna JavaScript
  4. Obiekty
  5. Math
  6. Math.max()
  • Change language
  • View in English

Table of contents

  • Podsumowanie
  • Opis
  • Przykłady
  • Zobacz także

Math.max()

Podsumowanie

Zwraca największą z podanych liczb.

Składnia

Math.max([value1[, value2[, ...]]])

Parametry

value1, value2, ...
liczby.

Opis

Ponieważ max jest statyczną metodą obiektu Math, zawsze odwołujemy się do niej poprzez Math.max(), a nie jak do metody instancji obiektu Math utworzonej przez użytkownika.

Przykłady

Przykład: Zastosowanie Math.max()

Math.max(10, 20);   //  20
Math.max(-10, -20); // -10
Math.max(-10, 20);  //  20

Zobacz także

  • Math.min()

Last modified: Apr 21, 2021, by MDN contributors

Change your language

Related Topics

  1. Obiekty
  2. Math
  3. Własności
    1. Math.E
    2. Math.LN10
    3. Math.LN2
    4. Math.LOG10E
    5. Math.LOG2E
    6. Math.PI
    7. Math.SQRT1_2
    8. Math.SQRT2
  4. Metody
    1. Math.abs()
    2. Math.acos()
    3. Math.acosh()
    4. Math.asin()
    5. Math.asinh()
    6. Math.atan()
    7. Math.atan2()
    8. Math.atanh()
    9. Math.cbrt()
    10. Math.ceil()
    11. Math.clz32()
    12. Math.cos()
    13. Math.cosh()
    14. Math.exp()
    15. Math.expm1()
    16. Math.floor()
    17. Math.fround()
    18. Math.hypot()
    19. Math.imul()
    20. Math.log()
    21. Math.log10()
    22. Math.log1p()
    23. Math.log2()
    24. Math.max()
    25. Math.min()
    26. Math.pow()
    27. Math.random()
    28. Math.round()
    29. Math.sign()
    30. Math.sin()
    31. Math.sinh()
    32. Math.sqrt()
    33. Math.tan()
    34. Math.tanh()
    35. Math.trunc()
  5. Inheritance:
  6. Object
  7. Własności
    1. Object.prototype.constructor
    2. This deprecated API should no longer be used, but will probably still work. Object.prototype.__proto__
  8. Metody
    1. This deprecated API should no longer be used, but will probably still work. Object.prototype.__defineGetter__()
    2. This deprecated API should no longer be used, but will probably still work. Object.prototype.__defineSetter__()
    3. This deprecated API should no longer be used, but will probably still work. Object.prototype.__lookupGetter__()
    4. This deprecated API should no longer be used, but will probably still work. Object.prototype.__lookupSetter__()
    5. Object.prototype.hasOwnProperty()
    6. Object.prototype.isPrototypeOf()
    7. Object.prototype.propertyIsEnumerable()
    8. Object.setPrototypeOf()
    9. Object.prototype.toLocaleString()
    10. This API has not been standardized. This is an obsolete API and is no longer guaranteed to work. Object.prototype.toSource()
    11. Object.prototype.toString()
    12. Object.prototype.valueOf()
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

Mozilla

© 2005-2021 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies