If Statement in JavaScript

An if statement in JavaScript is the simplest decision-making statement that allows to specify an alternative path of execution in a program. It is used to change the flow of execution in the program. This statement executes a block of…


