-1

Python:

num = int(input('Please enter a number between 0 to 6'))

def someFunction(num):
  # code here

How can I do this in JavaScript?

1 Answers1

0

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
}
TechySharnav
  • 4,869
  • 2
  • 11
  • 29