How to check if current page is homepage in Magento Template

Sometimes we need to show particular block or code only on home page. In such a scenario we must need to know how to check if current page is homepage or not. Below is the code snippet that will detect that current template is home page template. Lets try this code at any phtml file(…)