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

Code Example 1

// if expression {
// 	do something
// }

var a: Int = 3
if a == 3 {
	print("Hello World")
} else if a < 3 {
	print("dlroW olleH")
} else {
	print("42")
}

Learn ReactJs, React Native from akashmittal.com