我的代码似乎正确,但我不知道为什么会收到此错误:
未捕获的TypeError:无法读取null的属性“ toUpperCase”
这是我的代码:
//The function is executed after someone clicks the "Take the Quiz"
function startquiz() {
//The variable for the first question
var FirstAnwser = prompt("Who posted the first youtube video?");
//The if statement for the first question
if (FirstAnwser.toUpperCase() === 'JAWED KARIM') {
//If the person is correct a dialog box that says correct pops up
alert("Correct");
//The Variable for the second question
var SecondAnwser = prompt("When was the domain name youtube.com activated?");
if (SecondAnwser.toUpperCase() === 'FEBUARY …Run Code Online (Sandbox Code Playgroud) javascript ×1