True

Updated: 04/26/2017 by Computer Hope

In programming, true is a Boolean value that is used when the result of a logical statement is true (as opposed to false). For example, you may want to check whether two values are equal and run one block of code when this is true and a different block of code if this is not true. Below, is an example of some JavaScript code as an example.

var x = 2;
var y = 2;
if (x === y) {
  window.alert("x equal to y is true");
}
else {
  window.alert("x equal to y is not true");
}

In this code, if x is equal to y, the user receives an alert that says "x equal to y is true". Otherwise, the user receives an alert that says "x equal to y is false".

Boolean, False, Programming terms