JavaScript Battery Status API Get time left until battery is fully charged


Example

// Get the battery API
navigator.getBattery().then(function(battery) {
    console.log( "Battery will get fully charged in ", battery.chargingTime, " seconds" );
});