0
0
Javascriptprogramming~5 mins

Why arrays are needed in Javascript - Quick Recap

Choose your learning style9 modes available
Recall & Review
beginner
What is an array in JavaScript?
An array is a special variable that can hold multiple values in a single place, like a list of items.
Click to reveal answer
beginner
Why do we need arrays instead of separate variables?
Arrays help us store many related values together, so we can easily manage and access them without creating many separate variables.
Click to reveal answer
beginner
How do arrays help in real life?
Arrays are like a shopping list where you keep all items in one place, making it easy to add, remove, or find things quickly.
Click to reveal answer
beginner
What problem do arrays solve in programming?
Arrays solve the problem of handling many values efficiently by grouping them, so you don’t need to write repetitive code for each value.
Click to reveal answer
beginner
Can you give an example of when to use an array?
Use an array when you want to store a list of student names, scores, or any group of related data that belongs together.
Click to reveal answer
What is the main reason to use an array?
ATo store multiple values in one variable
BTo store only one value
CTo create a function
DTo write comments
Which of these is a real-life example of an array?
AA list of books on a shelf
BA single book
CA pen
DA chair
What happens if you don’t use arrays for multiple values?
AYou can store all values in one variable easily
BYou need many separate variables
CYour program runs faster
DYou don’t need to store values
How does an array help with code repetition?
AIt creates new variables automatically
BIt increases repetition
CIt deletes code
DIt reduces repetition by grouping values
Which of these is NOT a benefit of arrays?
AStoring multiple related values
BMaking code easier to read
CAutomatically fixing bugs
DAccessing values by position
Explain why arrays are useful in programming with a simple example.
Think about how you keep many items together in real life.
You got /3 concepts.
    Describe what problems would happen if we didn’t have arrays.
    Imagine writing a separate variable for every item you want to store.
    You got /3 concepts.