Outputs in JavaScript (OCR A-Level Computer Science): Flashcards

📚Flashcards
Outputs in JavaScript
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

10 cards from this deck

Show

Purpose of console.log()

Outputs information to the browser's console

Purpose of alert()

Displays a pop-up message

What document.write() does

Writes output directly to the HTML document

What innerHTML does

Writes output directly to an HTML element

Main output methods in JavaScript

console.log(), alert(), document.write(), innerHTML

Common mistake with document.write()

It overwrites the document

When to use console.log()

For debugging

When to use alert()

For interacting with users

How often should document.write() be used

Sparingly

Output destinations in JavaScript

Alerts, HTML elements, browser console

Explore OCR A-Level Computer Science Revision Notes by Topics

Explore OCR A-Level Computer Science Model Answers by Topics

Explore OCR A-Level Computer Science Quizzes by Topics

Explore OCR A-Level Computer Science Exam Questions by Topics

Join 100,000+ A-Level students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.