My code includes a function called UIAlerts:
function UIAlerts() {}
I then use the prototype methodology to assign a variable to this function:
UIAlerts.prototype.questions = []
Next, I add a function to this array:
UIAlerts.prototype.questions.push(function(){
//perform an action
});
When a click event occurs, the following code is executed:
if (UIAlerts.prototype.questions && UIAlertController.prototype.questions.length > 0) {
UIAlerts.prototype.questions.slice(0, 1);
UIAlerts.prototype.questions[0] && UIAlertController.prototype.questions[0]();
}
if (UIAlerts.prototype.questions.length == 0)
UIAlerts.prototype.questions = undefined;
The issue I am facing is that the slice method does not remove the first item in the function array. Any suggestions?