Conditional structures in JavaScript are used to make decisions in your code based on certain conditions. They allow you to…