Complete the code to add an element at the front of the deque.
deque.[1](10);
To add an element at the front of a deque, use pushFront.
Complete the code to remove an element from the back of the deque.
const removed = deque.[1]();To remove an element from the back of a deque, use popBack.
Fix the error in the code to check if the deque is empty.
if (deque.[1]()) { console.log('Deque is empty'); }
The method isEmpty() checks if the deque has no elements.
Fill both blanks to create a deque from an array and add an element at the back.
const deque = new Deque([1]); deque.[2](20);
Initialize deque with an array [1, 2, 3] and add 20 at the back using pushBack.
Fill all three blanks to remove from front, add at front, and check size.
deque.[1](); deque.[2](5); const size = deque.[3];
Remove from front with popFront(), add 5 at front with pushFront(5), and get size with length.
