Variables & Constants in JavaScript (OCR A-Level Computer Science): Quizzes

📚Quizzes
Variables & Constants in JavaScript
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

10 questions from this quiz

Show

What do variables in JavaScript do?

Store & modify data values

What are constants in JavaScript?

Fixed values, cannot change once set

Which keyword is used to declare constants?

const

Which keywords can declare variables?

let or var

Which basic data types does JavaScript support?

Numbers, strings, booleans

Can you reassign a constant after initial assignment?

No, cannot be reassigned

What type of scope does var have?

Function scope

When should you use let?

For variables that change

Why avoid using var in favor of let or const?

var has function scope, unexpected results

Which correctly declares a constant?

const pi = 3.14159;

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 Flashcards by Topics

Explore OCR A-Level Computer Science Exam Questions by Topics

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

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