let chatConversations = new Array();
jQuery('.CChatWindow').each(function(){
if (jQuery(this).is(":visible") && jQuery(this).attr("data-conversationid") != 0) {
alert(jQuery(this).attr("data-conversationid")); // returns 1 and 2
chatConversations.push(jQuery(this).attr("data-conversationid"));
}
});
alert(chatConversations); // returns an empty string
Can anyone help me figure out why my code is not working? I seem to have an issue with array.push. Thanks!