Lithium-Ion Battery Basics
Modern devices use lithium-ion (Li-ion) or lithium-polymer (Li-Po) batteries. They work by moving lithium ions between an anode and cathode through an electrolyte. Key advantages include high energy density, no memory effect, and low self-discharge. Battery capacity is measured in milliamp-hours (mAh) or watt-hours (Wh).
Battery Health & Longevity
Lithium-ion batteries degrade over time. A typical laptop battery retains 80% capacity after 300-500 charge cycles. To maximize lifespan: keep charge between 20-80%, avoid extreme temperatures, don't leave devices plugged in at 100% constantly, and use the manufacturer's recommended charger. Fast charging generates more heat, which can accelerate degradation over time.
Battery Status API
The Battery Status API provides information about the system battery. It reports the current charge level (0-100%), whether the device is charging, and estimated time until full charge or discharge. Note that this API has been deprecated in some browsers (like Firefox) due to privacy concerns — battery status could potentially be used for device fingerprinting.