Python:
num = int(input('Please enter a number between 0 to 6'))
def someFunction(num):
# code here
How can I do this in JavaScript?
Python:
num = int(input('Please enter a number between 0 to 6'))
def someFunction(num):
# code here
How can I do this in JavaScript?
If you are going to run the code on browser, you can use window's prompt
method, to take input from user.
let num = parseInt(prompt("Please enter a number between 0 to 6"))
function someFunction(num){
//code here
}