JavaScript Operator: less than or equal
[this page | pdf | back links]
In JavaScript,
the <= operator is
the ‘less than or equal’ operator, e.g:
x
|
y
|
x <= y
|
8
|
8
|
true
|
8
|
5
|
false
|
EXAMPLE:
HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>table,th,tr,td {border: 1px solid black;
border-collapse: collapse; text-align: center;}</style>
</head>
<body>
<table>
<tr>
<th> x </th><th> y </th>
<th><code>x < y</code></th>
</tr>
<tr>
<td><code>8</code></td><td><code>5</code></td>
<td><code id="A"></code></td>
</tr>
<tr>
<td><code>8</code></td><td><code>8</code></td>
<td><code id="B"></code></td>
</tr>
<tr>
<td><code>8</code></td><td><code>11</code></td>
<td><code id="C"></code></td>
</tr>
</table>
<script>
document.getElementById("A").innerHTML = 8 <= 5;
document.getElementById("B").innerHTML = 8 <= 8;
document.getElementById("C").innerHTML = 8 <= 11;
</script>
</body>
</html>
|
NAVIGATION LINKS
Contents | Prev | Next | JavaScript Operators