Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <h1>Opérateurs JavaScript</h1> <h2>L'opérateur typeof</h2> <p>L'opérateur typeof renvoie le type d'une variable ou d'une expression :</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "'John' is " + typeof "John" + "<br><br>" + "('John' + 'Doe') is " + typeof ("John" + "Doe") + "<br><br>" + "3.14 is " + typeof 3.14 + "<br><br>" + "33 is " + typeof 33 + "<br><br>" + "(33 + 66) is " + typeof (33 + 66) + "<br><br>" + "NaN is " + typeof NaN + "<br><br>" + "true is " + typeof true + "<br><br>" + "false is " + typeof false + "<br><br>" + "1234n is " + typeof 1234n + "<br><br>" + "Symbol() is " + typeof Symbol() + "<br><br>" + "x est " + typeof x; </script> </body> </html>