# [Swift] Summary about Bool type

## Introduction

This time, we will output about `Bool type`. Because, although I can explain the `String type` and ʻInt type`, I couldn't verbalize the Bool type, so I will output it again here.

## What is Bool type?

There is a concept of `truth value` in the world of programming languages. The one that represents the truth value is `Bool type`. There are `true` and` false` literals that represent truth values, and when you assign a `true` or` false` to a variable, the `Bool type` is assigned as an implicit type.

``````var sample = true //Bool type
``````

## How to use Bool type

Bool type is used for `logical operation`. An operation is to perform some processing on the data and obtain the resulting value.

## Logical operations and operators

type Contents Operator to use
denial Reverse the truth of the truth value Prefix operator!
Logical sum True if either of the multiple truth values is true Medium value operator ｜｜
Logical AND True if both of the multiple truth values are true Neutral operator&&

## Example of logical operation

``````//denial
let sample1 = true //true (true)
let sample2 = !sample1 //false (false)

//Logical sum
sample1 || sample2 //true because sample1 is true

//Logical AND
sasmple1 && sample2 //sample1 is true, but sample2 is false, so false
``````