Magento: How to check if current page is homepage?

Here is a quick Magento code to check if the current page is homepage or not.

If you are in template/page/html/header.phtml template file, then you can check for homepage with the following code:

Magento