getBattery()
method provides information about the system's battery, returns a battery promise, which is resolved in a BatteryManager
object providing also some new events you can handle to monitor the battery status.. This implements the Battery Status API; see that documentation for additional details, a guide to using the API, and sample code.