Complete the code to push an element onto an array-based stack.
stack.[1](value);To add an element to the top of an array stack, we use the push method.
Complete the code to create a new node for a linked list stack.
const newNode = { value: val, [1]: null };Each node in a linked list stack points to the next node using the next property.
Fix the error in popping an element from an array stack.
const popped = stack.[1]();To remove the top element from an array stack, use the pop method.
Fill both blanks to correctly push a node onto a linked list stack.
newNode.[1] = this.[2]; this.head = newNode;
When pushing a node, set its next to the current head, then update head to the new node.
Fill all three blanks to check if the array stack is empty.
if (stack.[1] === [2]) { return [3]; }
To check if the stack is empty, compare length to 0 and return true if empty.
