In JavaScript, you can trigger the printer browser dialog by using the JavaScript print function: print().
Unlike in many other programming languages, in JavaScript, print() is not used to print messages to a console, we use console.log() for that.
For a practical print() example check out this tutorial.