JavaScript is an object-based script programming language, then its input and output is done by an object. The relevant input can be done by the window (Window) object, and the output can be implemented by the method of the document object.
First, windows and input output
Please see the example below: