user
You need to complete the following task:

Write a JavaScript code to generate a random number between 1 to 10


assistant
var randomNumber = Math.floor(Math.random() * 10) + 1;
console.log(randomNumber);