Questions and Answers
Which index does 'banana' have in the array var fruits = ['apple', 'banana', 'cherry', 'date']?
1
What is the result of accessing an element in an array using its index directly?
It displays the element at the accessed index.
What is meant by JavaScript arrays being zero-indexed?
The first element in the array has an index of 0.
What does the push method do when used with arrays?
Signup and view all the answers
Which method removes the last element from an array in JavaScript?
Signup and view all the answers
If an array has 5 elements, what is its length property value?
Signup and view all the answers
In the binary representation of a decimal number, where is the Most Significant Bit (MSB) located?
Signup and view all the answers
When converting decimal numbers to binary, what is the base of the number in binary form?
Signup and view all the answers
What is the binary equivalent of the decimal number 10?
Signup and view all the answers
In the decimal to binary conversion process, what should be written first in the binary number?
Signup and view all the answers
If a decimal number is 25, what would be its binary equivalent?
Signup and view all the answers
What does it mean when a decimal number is represented as 1101 in binary?
Signup and view all the answers
What is the purpose of using a graph in real-world problems?
Signup and view all the answers
How are data structures beneficial in programming?
Signup and view all the answers
What is a 'List' in JavaScript commonly referred to as?
Signup and view all the answers
How are elements indexed in JavaScript arrays?
Signup and view all the answers
What does it mean when it is said that JavaScript arrays are zero-indexed?
Signup and view all the answers
Which statement best describes the relationship between elements and indices in JavaScript arrays?
Signup and view all the answers
What is the purpose of a switch-case statement in programming?
Signup and view all the answers
What happens if the break statement is not used inside a case block of a switch statement?
Signup and view all the answers
Which loop type is suitable when the number of iterations is known before entering the loop?
Signup and view all the answers
In a while loop, when is the condition/expression evaluated?
Signup and view all the answers
What distinguishes a for-loop from other loop types?
Signup and view all the answers
Which loop type is often referred to as a pre-test loop?
Signup and view all the answers
What is the defining principle of a stack data structure?
Signup and view all the answers
Which of the following is a type of stack data structure that allows dynamic resizing?
Signup and view all the answers
What happens if you try to add an element to a full fixed size stack?
Signup and view all the answers
Which operation in a stack data structure is used to remove an element from the top of the stack?
Signup and view all the answers
In a stack data structure, which operation returns the size of the stack?
Signup and view all the answers
What principle does a queue data structure follow?
Signup and view all the answers
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.