Way2tutorial Snippet Editor
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JavaScript Comparison Operators</title> </head> <body> <pre> <!-- Use pre element for work document.writeln() method --> <script type="text/javascript"> document.writeln("Equal : ", 5 == 5); // true document.writeln("Equal : ", 5 == '5'); // true document.writeln("Identical equal : ", 5 === '5'); // false type not same document.writeln("Not equal : ", 5 != 10); // true document.writeln("Not equal : ", 5 != '10'); // true document.writeln("Identical not equal: ", 5 !== '10'); // true document.writeln("Greater than : ", 5 > 10); // false document.writeln("Less then : ", 5 < 10); // true document.writeln("Greater than, equal: ", 5 >= 5); // true document.writeln("Less than, equal : ", 5 <= 5); // true </script> </pre> </body> </html>