javascript get battery level code example
Example: battery percentage js
navigator.getBattery()
.then(function(battery) {
console.log(battery.level);
});
navigator.getBattery()
.then(function(battery) {
console.log(battery.level);
});