Just try to ask them to input their numbers or grade, separated by a comma and then you can split on it.

var arr = prompt("Enter your numbers").split(",")

Or, ask prompt ten times

var arr = [];
for(var i = 0; i < 10; i++)
   arr.push(prompt("Enter a number");

If you want them to be numbers, just prefix prompt with +, so it becomes a number(provided they're actual numbers) or just do

arr = arr.map(Number);
Answer from Amit Joki on Stack Overflow
🌐
Codecademy
codecademy.com › forum_questions › 520ac81bf10c6030ad000e07
Prompts as information to put in an array. | Codecademy
var first_name = prompt(please enter your first name.) ... Doing this for the rest of the person’s attributes, it would take the information entered and then list them in the contacts array which could then be listed, searched by, etc.
Discussions

Adding User Input to the Array in JavaScript
Zvonimir Perkovic is having issues with: Hi everyone, Here is the problem I'm struggling with: Ask the user how many students are in the class with a prompt.... More on teamtreehouse.com
🌐 teamtreehouse.com
2
October 1, 2016
javascript - Using an array function inside a prompt - Stack Overflow
I am doing a project for a class in which I have to have a user input names, and then have the program alphabetically sort the names. The code that I've come up with isn't very elegant, but it work... More on stackoverflow.com
🌐 stackoverflow.com
How to create an array from names input through prompt?
Questions and posts about frontend ... to JavaScript on the backend. ... A subreddit for all questions related to programming in any language. ... I am trying to develop a C++ program that creates a text menu which allows the user to choose how to input data into an array (keyboard or from a text file). How do I limit the array size to 100? ... Prompt engineering ... More on reddit.com
🌐 r/learnjavascript
2
2
March 1, 2023
how do i fix this javascript prompt=userInput from array to alert problem - Stack Overflow
Once I run this code i should be getting userInput which is a number between 0-3 and the name of the pizza in alert box. What am I doing wrong? var menu = [ "0 = Calzone", "1 = Ost & More on stackoverflow.com
🌐 stackoverflow.com
🌐
SitePoint
sitepoint.com › javascript
Js Array Prompt Input Data - JavaScript - SitePoint Forums | Web Development & Design Community
November 16, 2011 - I am playing about with javascript arrays. Have recently just sat today looking through w3c and going through pages in a w3c book i bought on javascript and ajex and i was wondering whether you guys can help me on this little thing im playing on. someone suggested if im wanting to display stuff to use a drop down box but i need to learn to use arrays as the course im studying in college is on javascript and i feel this would be beneficial for me personally to know. i want to know if its possib...
🌐
Team Treehouse
teamtreehouse.com › community › adding-user-input-to-the-array-in-javascript
Adding User Input to the Array in JavaScript (Example) | Treehouse Community
October 1, 2016 - Output the list of student names to the screen by looping through the new array of student names. I would appreciate any hint for the steps 2 & 3. ... As always, Steven Parker has provided a great answer. I have opted for an alternate approach using 'recursion'. Explanation below. const readline = require('readline') const rl = readline.createInterface({ input: process.stdin, output: process.stdout, prompt: ':' }) let numberOfStudents let studentsNames = [] // Helper functions function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n) } function ordinalSuffixOf(i) { var j = i % 10, k
🌐
EDUCBA
educba.com › home › software development › software development tutorials › javascript tutorial › javascript prompt
JavaScript prompt | How does prompt pop up work in JavaScript?
June 22, 2023 - Next, for loop iterating array value and display back to the user. ... <!DOCTYPE html> <html> <body> <font color="green"> <h1 align="center">Displaying Addition, Subtraction, Multiplication and Division for User Input</h1> </font> <script> var a=parseInt(prompt("enter first value","1")); var b=parseInt(prompt("enter second value","2")); function getMyAddition() { document.write("Addition of "+a+" and "+b+" is =>"+(a+b)+"<br>"); } function getMySubtraction() { document.write("Subtraction of "+a+" and "+b+" is =>"+(b-a)+"<br>"); } function getMyMultiplication() { document.write("Multiplication of "+a+" and "+b+" is =>"+(a*b)+"<br>"); } function getMyDivision() { document.write("Division of "+a+" and "+b+" is =>"+(b/a)); } getMyAddition(); getMySubtraction(); getMyMultiplication(); getMyDivision(); </script> </body> </html>
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
W3Schools
w3schools.com › jsref › met_win_prompt.asp
Window prompt() Method
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST ... Array[ ] Array( ) at() concat() constructor copyWithin() entries() every() fill() filter() find() findIndex() findLast() findLastIndex() flat() flatMap() forEach() from() includes() indexOf() isArray() join() keys() lastIndexOf() length map() of() pop() prototype push() reduce() reduceRight() rest (...) reverse() shift() slice() some() sort() splice() spread (...) toReversed() toSorted() toSpliced() toString() unshift() values() valueOf() with() JS Boolean
🌐
WebDeveloper.com
webdeveloper.com › community › 297613-how-to-store-prompt-inputs-in-an-array-and-then-print-that-data-out
How to store prompt inputs in an array and then print that data out
Also, document.write of an array 'blind' like that is probably going to look pretty ugly, you'd want to at least throw some line-breaks in there by iterating through the array. (function() { <i> </i>var results = [], answer, i; <i> </i>while ((answer = prompt('Geef een getal in!')) &gt; 0) results.push(answer); <i> </i>for (i = 0; i &lt; results.length; i++) document.write(results[i] + '&lt;br /&gt;'); })(); Is probably more along the lines of what you are trying to do.
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 15559947 › using-an-array-function-inside-a-prompt
javascript - Using an array function inside a prompt - Stack Overflow
<body> <script> function disp_prompt() { var name1=prompt("Please enter three names:","Name 1") var name2=prompt("Please enter three names:","Name 2") var name3=prompt("Please enter three names:","Name 3") document.getElementById("msg1").innerHTML= name1; document.getElementById("msg2").innerHTML= name2; document.getElementById("msg3").innerHTML= name3; } </script> <center><input type="button" onclick="disp_prompt()" value="Click Here"></center> <br> <h2><center><div id="msg1"></div></center></h2> <h2><center><div id="msg2"></div></center></h2> <h2><center><div id="msg3"></div></center></h2> </body> javascript · arrays ·
🌐
Reddit
reddit.com › r/learnjavascript › how to create an array from names input through prompt?
r/learnjavascript on Reddit: How to create an array from names input through prompt?
March 1, 2023 - Questions and posts about frontend development in general are welcome, as are all posts pertaining to JavaScript on the backend. ... A subreddit for all questions related to programming in any language. ... I am trying to develop a C++ program that creates a text menu which allows the user to choose how to input data into an array (keyboard or from a text file). How do I limit the array size to 100? ... Prompt engineering is the application of engineering practices to the development of prompts - i.e., inputs into generative models like GPT or Midjourney.
🌐
Teachics
teachics.org › home › javascript examples › javascript program to read values using prompt popup box
JavaScript program to read values using prompt popup box | JavaScript Examples | Teachics
June 4, 2024 - <html> <body> <script> var n = window.prompt("Enter size of the array"); var arr = new Array(); var sum = 0; for (let i = 1; i <= n; i++) { arr[i] = parseInt(window.prompt("Enter element " + i)); sum = sum + arr[i]; } alert("Sum =" + sum); </script> ...
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
Arrays
The array has 3 values: initially it had two, plus the function. ... Asks the user for values using prompt and stores the values in the array.
🌐
IncludeHelp
includehelp.com › code-snippets › create-a-user-defined-array-in-javascript.aspx
Create a user defined array in JavaScript
October 17, 2017 - var inputArray = []; var size = 5; //Maximum Array size for(var i=0; i<size; i++) { //Taking Input from user inputArray[i] = prompt('Enter Element ' + (i+1)); } //Print the array in the console. console.log(inputArray); In the above code, we have an empty array inputArray.
🌐
Stack Overflow
stackoverflow.com › questions › 53085968 › how-do-i-fix-this-javascript-prompt-userinput-from-array-to-alert-problem
how do i fix this javascript prompt=userInput from array to alert problem - Stack Overflow
var userInput = prompt("hvilket meny ønsker du å bestille?" + menu); if (userInput) alert("pizza " + userInput + "..... ... The reason you receive undefined is because you're trying to use userInput before it's finally declared.
🌐
GitHub
github.com › tj › co-prompt › issues › 12
prompt in an array · Issue #12 · tj/co-prompt
I want to loop through an array and create a series of prompts based off of this array. I seem to be having trouble stopping the loop in order to collect each prompt sequentially. For Example, if I have an array named DefaultArray, I wan...
🌐
Stack Overflow
stackoverflow.com › questions › 70949997 › how-to-select-an-item-from-an-array-in-javascript-with-prompt
function - How to select an Item from an array in Javascript with prompt - Stack Overflow
How are you today?"); }; alert("What would you like to order?" + customerName); function selectItems() { var select = mainMenu if (select != null) return alert("That will be 15$") }; prompt(`What would you like, ${mainMenu}`);
🌐
SitePoint
sitepoint.com › javascript
Need help with an prompt to array in a while loop - JavaScript - SitePoint Forums | Web Development & Design Community
March 7, 2010 - my assignment write a while loop that prompts user to enter name add their names to an array if they enter “exit” end the prompting sort array and list in sorted order this is what i got so far. sooo confused because i cant get the user input into an array var names = new Array(); var loopCounter; loopCounter = 0; while (x != “exit”) { var names[loopCounter] = prompt(“enter name”,“”); loopCounter++ } var i; names.sort(); for (i=0;i
🌐
Best of JS
bestofjs.org › projects › prompts
Best of JS • Prompts
Trends and data about Prompts project. Lightweight, beautiful and user-friendly interactive prompts