It depends on the environment that your JavaScript is executing in.
In the browser, there is no standard input (the browser isn’t a console). The input would come generally from some textbox element in a form on the page.
If you’re using something like Rhino, then you can import the standard Java I/O classes and read from stdin that way (see the second example no longer on the wiki).
Related Posts:
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How to add a class to a given element?
- How to deal with net::ERR_SSL_PROTOCOL_ERROR?
- What is the way of declaring an array in JavaScript?
- How to disable JavaScript in Chrome Developer Tools?
- Reactjs – Form input validation
- What is event bubbling and capturing?
- What is lexical scope?
- Remove element by id
- await is only valid in async function
- Remove duplicate values from JS array [duplicate]
- How to read an external local JSON file in JavaScript?
- Angular: mat-form-field must contain a MatFormFieldControl
- JS – ReferenceError: fetch is not defined
- Check if a variable is a string in JavaScript
- How can I add a key/value pair to a JavaScript object?
- Adding an onclick event to a div element
- Typescript : Property does not exist on type ‘object’
- How to check if array is empty or does not exist?
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Preloading images with JavaScript
- How to print elements from array with javascript
- What is the JavaScript version of sleep()?
- How do I scroll to an element using JavaScript?
- Finding largest integer in an array in JavaScript
- javascript set cookie with expire time
- Angular: conditional class with *ngClass
- How can I add a key/value pair to a JavaScript object?
- How do I change an HTML selected option using JavaScript?
- Expected linebreaks to be ‘LF’ but found ‘CRLF’ linebreak-style
- Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH
- TypeError: Invalid attempt to spread non-iterable instance
- Declaring multiple variables in JavaScript
- How to print a number with commas as thousands separators in JavaScript
- Convert Array to Object
- CSS Animation onClick
- Partial render in HTML/JavaScript
- How can I check if a string is a valid number?
- Javascript setInterval not working
- Set value to currency in
- How to add 30 minutes to a JavaScript Date object?
- How to execute a function when page has fully loaded?
- Is there a “not in” operator in JavaScript for checking object properties?
- How to add a keyboard listener to my onClick handler?
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- HTML Entity Decode
- Why am i receiving this jsfiddle error, document.write can be a form of eval
- Bootstrap modal – close modal when “call to action” button is clicked
- Javascript: difference between a statement and an expression?
- Keep getting a “Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup” when attempting to google plus login on my web app
- The entity name must immediately follow the ‘&’ in the entity reference
- How can I use goto in Javascript?
- Javascript Function that returns true if a letter?
- How do I know which version of Javascript I’m using?
- getContext is not a function
- lodash multi-column sortBy
- Calling a JavaScript function in another js file
- JavaScript code not running in HTML5 document
- What is the cause for “angular is not defined”
- Unexpected token < in first line of HTML
- ngular is automatically adding ‘ng-invalid’ class on ‘required’ fields
- How to set “style=display:none;” using jQuery’s attr method?
- How to dequeue a script?
- How to use wp_localize_script in custom page template?
- Javascript WP Object Documentation?
- Show only images and videos in a wp.media window
- WordPress Rest API
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- Force core to use .dev JavaScript files
- TinyMCE Button to Insert Multiple Lines of Text?
- How to add extra attributes to the script tag added via wp_localize_script()
- How to overwrite JS variable with wp_localize _script?
- How to get value of selected page template in Gutenberg editor?
- Conditional fields in contact form 7 not working
- How to place script in footer?
- Only displaying zip files with wp media
- AngularJS with route and JSON API
- List of JS Events for Widgets?
- Authentication with the Rest API when using an External Application
- Get Block Attributes in JSON REST API
- Open Featured Image Modal in WordPress Gutenberg onClick of a button
- Override do_item() Function to Add Extra Attribute to Scripts
- Is it possible to pass js variable to template file
- Variable equals another variable and then equals another variable
- in jquery read a multidimensional array via wp_localize_script()
- Uncaught ReferenceError: jQuery is not defined – although jQuery is loaded [closed]
- How can I import one custom block into another?
- Gutenberg Blocks: how to determine an index of the current inner block?
- Custom JS on a specific page
- How to import a JavaScript Library into WordPress
- How to change the link address from internal to external
- How do I load urls from an external .js file to my admin head?
- Uncaught TypeError: Cannot read property ‘add’ of undefined bp-plupload.min.js
- Where is the Javascript attribute window._wpCustomHeaderSettings defined?
- How to verify that a field has a value before adding a term to a taxonomy
- how to include js in widget?
- JS files landing on page but not working, using childtheme of twentyeleven
- List unused javascript for easy removal
- Include Facebook Javascript SDK In WordPress
- How can I look at/edit what’s being sent to post.php when I hit the publish/update button?