I'm trying to get existCount from an array, which has id in selected array.
But something went wrong, I had an item with id = 5493 but existCount.length = 0
My JS code:
Chrome Console view:
Where my fault?
How can I fix it?
Thanks!
I'm trying to get existCount from an array, which has id in selected array.
But something went wrong, I had an item with id = 5493 but existCount.length = 0
My JS code:
Chrome Console view:
Where my fault?
How can I fix it?
Thanks!
Copyright © 2021 Jogjafile Inc.


The problem are the types of
item.idandscript.script_id, you're comparing numbers and strings.An alternative is converting to number the
script_idThis approach uses the
+to convert that string to number and make the correct comparisonThis is an example to illustrate.