// Generate a random code
var code = Math.random().toString(36).substring(2, 10);
// Print the code
console.log('Your code is: ' + code);
// Get the user's input
var input = prompt('Enter verification code:');
// Compare user input with the generated code
if (input === code) {
console.log('Correct!');
} else {
console.log('Incorrect!');
}
没有回复内容