Output

The highest prime number discovered so far is:

Sample Code

Worker demo: One-core computation, the main document spawns a worker to compute prime numbers, and progressively displays the most recently found prime number.

HTML:

  
  <p>The highest prime number discovered so far is: <output id="result"></output></p>
  <script>
    var worker = new Worker('worker.js');
    worker.onmessage = function (event) {
    document.getElementById('result').textContent = event.data;
  };
  </script>