Discussion Forum : Lexical Structures
Question - The pop() method of the array does which of the following task ?
Options:
A .  decrements the total length by 1
B .  increments the total length by 1
C .  prints the first element but no effect on the length
D .  None of the above
Answer: Option A


Arrays have a pop() method (it works with push()) that reduces the length of an array by 1 but also returns the value of the deleted element.



Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *