JavaScript Basics Flashcards
1
Q
What is JavaScript used for in websites?
A
To add interactivity and dynamic behaviour.
2
Q
What is a variable in JavaScript?
A
A container for storing data.
3
Q
What is an if statement?
A
A condition that runs code only if it’s true.
4
Q
What is a function in JavaScript?
A
A block of code that performs a task and can be reused.