Prime Numbers in JavaScript using Web Workers

Veröffentlicht am: 30 Juli 2018
auf dem Kanal: Mt. Ford Studios
1,919
25

In this JavaScript tutorial, we learn how to generate prime numbers using a HTML5 Web Worker. Web Workers are simply background processes that can be run without interfering with the user interface. We start off by creating a form where the user can input the number of primes required. We pass that information to our web worker in order to calculate that number of primes. During the process, we tell the web worker to send its progress to the main thread so that we can update the web page. It’s all pretty nifty!

Go ahead and download the code below to set up your own prime number web worker!

JAVASCRIPT TEMPLATE
https://drive.google.com/open?id=1W8v...

CODE
javascript-primes.html:
https://drive.google.com/open?id=1NRb...
primes-worker.js:
https://drive.google.com/open?id=1T-V...

USEFUL LINKS
HTML5 Web Workers:
https://www.w3schools.com/htmL/html5_...
Using Web Workers:
https://developer.mozilla.org/en-US/d...
Visual Studio Code:
https://code.visualstudio.com/

FIND US ON FACEBOOK
  / mountfordstudios  


Auf dieser Seite können Sie das Online-Video Prime Numbers in JavaScript using Web Workers mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Mt. Ford Studios 30 Juli 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,919 Mal angesehen und es wurde von 25 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!