Outputs in JavaScript (OCR A-Level Computer Science): Quizzes
📚Quizzes
Practise the questions
10 questions from this quiz
ShowHide
Practise the questions
10 questions from this quiz
What are outputs in JavaScript used for?
What are outputs in JavaScript used for?
Displaying information to the user
What does console.log() do?
What does console.log() do?
Outputs info to the browser's console
What does alert() do in JavaScript?
What does alert() do in JavaScript?
Displays a pop-up message
What does document.write() do?
What does document.write() do?
Writes output directly to HTML document
What is the problem with document.write()?
What is the problem with document.write()?
It overwrites the document
When is console.log() most appropriate to use?
When is console.log() most appropriate to use?
For debugging
When is alert() most appropriate to use?
When is alert() most appropriate to use?
For interacting with users
How should document.write() be used?
How should document.write() be used?
Sparingly
Which method outputs directly to an HTML element?
Which method outputs directly to an HTML element?
innerHTML
Which output method is essential for debugging?
Which output method is essential for debugging?
console.log()
