--- title: Math.LN10 slug: Web/JavaScript/Reference/Global_Objects/Math/LN10 tags: - JavaScript - Math - Propriété - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Math/LN10 original_slug: Web/JavaScript/Reference/Objets_globaux/Math/LN10 ---
La propriété Math.LN10 représente la valeur du logarithme naturel de 10, environ 2.302 :
Le code source de cet exemple interactif est disponible dans un dépôt GitHub. Si vous souhaitez contribuez à ces exemples, n'hésitez pas à cloner https://github.com/mdn/interactive-examples et à envoyer une pull request !
LN10 est une propriété statique de Math, elle doit toujours être utilisée avec la syntaxe Math.LN10, et ne pas être appelée comme propriété d'un autre objet qui aurait été créé (Math n'est pas un constructeur).
Math.LN10La fonction suivante renvoie le logarithme naturel de 10 :
function getNatLog10() {
return Math.LN10;
}
getNatLog10(); // 2.302585092994046
| Spécification | Statut | Commentaires |
|---|---|---|
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Définition initiale. Implémentée avec JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.8.1.2', 'Math.LN10')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-math.ln10', 'Math.LN10')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-math.ln10', 'Math.LN10')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Math.LN10")}}