Lister les propriétés et méthodes de l'objet math
Le
ast
bonjour,
Comment lister les propriétés et méthodes de l'objet math ?
Le script suivant ne marche pas:
<SCRIPT type="text/javascript">
for (var i in Math) {
document.write(i + "<BR>");
}
</SCRIPT>
Bizarrement, si je remplace math par document ou par window
ça marche.
Pourtant math est bien un objet.
Comment lister les propriétés et méthodes de l'objet math ?
Le script suivant ne marche pas:
<SCRIPT type="text/javascript">
for (var i in Math) {
document.write(i + "<BR>");
}
</SCRIPT>
Bizarrement, si je remplace math par document ou par window
ça marche.
Pourtant math est bien un objet.

Poser une question


ast a tapoté, le 23/02/2011 09:36:
Avec google on trouve tout de suite :
--
Stéphane
merci
Essayez en autres browsers, e.g. Chrome, Safari.
Essayez Enter, et puis mettez 'Math' en lieu de 'document' et Enter, et puis
choisissez-vous le bouton "If possible, use Object.getOwnPropertyNames(e
lement)" et Enter.
--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE8 FF3 Op10 Sf5 Cr7
news:comp.lang.javascript FAQ