# Pgroramming Fundamentals

**URL:** <https://forum.freecodecamp.org/t/pgroramming-fundamentals/106265>\
**Category:** General\
**Created:** [April 15, 2017, 2:39pm UTC](https://forum.freecodecamp.org/t/pgroramming-fundamentals/106265 "2017-04-15T14:39:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vipuldcoder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/vipuldcoder/32/68830_2.png) [@vipuldcoder](https://forum.freecodecamp.org/u/vipuldcoder)\
**Post date:** [April 15, 2017, 2:39pm UTC](https://forum.freecodecamp.org/t/pgroramming-fundamentals/106265/1 "2017-04-15T14:39:25Z")

</div>

How and why building with the if Statment??

---

<div class="post-metadata">

**Author:** ![macloo](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/macloo/32/162907_2.png) [@macloo](https://forum.freecodecamp.org/u/macloo)\
**Post date:** [April 15, 2017, 3:00pm UTC](https://forum.freecodecamp.org/t/pgroramming-fundamentals/106265/2 "2017-04-15T15:00:08Z")

</div>

Could you please explain more? I am not sure what you are asking about the if statement.

---

<div class="post-metadata">

**Author:** ![mirkoacimovic](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mirkoacimovic/32/45427_2.png) [@mirkoacimovic](https://forum.freecodecamp.org/u/mirkoacimovic)\
**Post date:** [April 15, 2017, 3:00pm UTC](https://forum.freecodecamp.org/t/pgroramming-fundamentals/106265/3 "2017-04-15T15:00:12Z")

</div>

if statement provides you to test value of certain variable and do different actions depending if condition is met or not (true or false).  
It is most basic technique that provides you program to behave differently under certain conditions. If the were no such statement program will be simple set of commands that executes in the same way every time and provides always same result, and programming would be extremely limited.

Example 🙂

var a = 5;

if(a \> 10){  
// do something  
} else {  
// do something else  
}

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:52pm UTC](https://forum.freecodecamp.org/t/pgroramming-fundamentals/106265/4 "2021-01-17T20:52:43Z")

</div>

Closed on January 17, 2021, 8:52pm UTC


