Poorly coded JavaScript can cause the browser to use more resources and hence device heats up or the battery drains faster.

Things to look for: Network calls , Unnecessary event listeners (touch , scroll), Expensive animations etc.

How to solve: Try to remove some animations and event listeners which cause lag to the web-app , those might be the ones using the most of the resources. This way you need to filter our the culprit code and optimise it.

You can refer to this BBC article for a detailed report on this : http://www.bbc.com/news/technology-17811557