array empty....

102 views
Skip to first unread message

Francisco Filho

unread,
Jan 25, 2023, 4:14:22 PM1/25/23
to KnockoutJS
Hello

I have an array that receives data from a widget, but sometimes the data is not accessible, despite existing in the widget
js: var meusitens = widget.cart.meusItens();

Console.log(meusitens)  
Console.log(meusitens.length) 

Return console: Array []
                             0

And when with data it returns 
Return Console data: Array [ {...} ]

In both cases the data is visible on the console, but in the first case the length is equal to zero
Reply all
Reply to author
Forward
0 new messages