Example 1 — Read hardwareConcurrency
Log the reported logical processor count.
console.log(navigator.hardwareConcurrency);
// e.g. 8 on a typical hyper-threaded laptop How It Works
- Read the property. No arguments — just
navigator.hardwareConcurrency. - Expect a number. MDN: at least
1, up to the logical processor count. - Treat it as a hint. Useful for parallelism, not exact hardware inventory.
- Baseline support. Safe in modern browsers without special flags.

