Demonstrate the use of chained if else.
<html>
<body>
<script>
bananas = 22
if (bananas == 6)
{
alert("We have six bananas.")
}
else if (bananas == 10)
{
alert("We have ten bananas.")
}
else
{
alert("We have another quantity of bananas.")
}
</script>
</body>
</html>
In the exemple above, we will fall into "We have another quantity of bananas.", because the first two ifs will evaluate to false. Try changing the value of bananas (to 6 or 10), to enter the first or second code blocks.