Edit in JSFiddle

var price = 1;

if(price < 10){
		console.log("It costs less than $10 so it must be cheap");
} else if(price >= 10 && price < 100){
		console.log("It costs between $10 and $100 so it must be of good value");
} else {
		console.log("It seems too expensive");
}

var color = 'red';
var output = document.getElementById("color");

if(color == 'red'){
		output.innerText = "red!";
    output.style.color = 'red';
} else if(color == 'blue'){
		output.innerText = "blue!";
    output.style.color = 'blue';
} else if(color == 'green'){
		output.innerText = "green!";
    output.style.color = 'green';
} else {
		output.innerText = "something else";
    output.style.color = 'purple';
}
<!-- Easy JavaScript # 20 - if...else statements  -->
<p>
Welcome to the 20th Easy JavaScript tutorial, part of <a href="http://www.easyprogramming.net">EasyProgramming.net</a>. In this tutorial, we start looking at Logic in JavaScript. After all, most of programming is all about logic. This tutorial covers a conditional statement called <code>if</code>. 
</p>
<p>
<code>if</code> statements allows you to control which portion of your code will execute by setting conditions. For example, if the dumbbell weighs less than 10 pounds, write "it's light" or else if it weighs more than 10 pounds, write "it's heavy". 
</p>
<p>
Creating conditional statements will allow you to create and manage custom workflows for you and your users. There is always more than one way to use a web application, 
</p>
<h2>
Syntax of an if...else statement:</h2>

<p>
<code><pre>
  if(condition is met){
      execute this piece of code;
    
  } else if(this condition is met){
      execute this piece of code;
    
  } else if(this condition is met){
      execute this piece of code;
    
  } else {
      execute this piece of code if no other condition is met;
  }
  </pre>
</code>
</p>
<p>
<h2>
Let's practice:</h2>

The color is <span id="color">___</span>
<br /><br />