Which of the following correctly checks if Web Workers are supported in the current browser?
-
A
if (typeof Worker !== 'undefined') { ... }
-
B
if (window.supportsWorkers) { ... }
-
C
if (navigator.webWorkers === true) { ... }
-
D
if (document.hasWorkerSupport()) { ... }