Functions & Procedures in JavaScript (OCR A-Level Computer Science): Quizzes

📚Quizzes
Functions & Procedures 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 functions and procedures in JavaScript encapsulate?

Reusable code

What is the main difference between functions and procedures in JavaScript?

Functions return outputs; procedures execute

Which syntax correctly defines a function in JavaScript?

function myFunction() { }

What can functions accept as inputs?

Parameters

What keyword is used to send results back from a function?

return

What does console.log(add(5, 3)) output if add returns a + b?

8

What will a function return if it doesn't use the return keyword?

undefined

Why are functions central to JavaScript programming?

Code reusability

In the example, what does the add function return?

a + b

What is a common mistake when writing functions?

Not using return in functions

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.