Check out example codes for "if unity". It will help you in understanding the concepts better.

Code Example 1

if () { // Put a condition in ().
	// If the condition is true then whatever is in here will happen.
} else if () { // Put a different condition in ().
	// If the if else condition is true then whatever is in here will happen.
} else { // If it doesn't equal any of the conditions.
	// If both conditions are false then this will happen.
}

Learn ReactJs, React Native from akashmittal.com