Sinisterly
Help with each() function - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Coding (https://sinister.li/Forum-Coding--71)
+--- Thread: Help with each() function (/Thread-Help-with-each-function)



Help with each() function - $ninja - 09-22-2015

Edit: isArray is a function, therefore it needs parantheses.


RE: Help with each() function - Dijkstra - 09-22-2015

isArray is a function "isArray()" and it belongs to Array.

Code:
Array.isArray([]);



RE: Help with each() function - $ninja - 09-22-2015

(09-22-2015, 02:50 AM)Dijkstra Wrote: isArray is a function "isArray()" and it belongs to Array.

Code:
Array.isArray([]);

Yup, just figured that out after looking it up on SO. Smile
But what about alert() not working?


RE: Help with each() function - Dijkstra - 09-22-2015

(09-22-2015, 03:13 AM)$ninja Wrote: Yup, just figured that out after looking it up on SO. Smile
But what about alert() not working?

No idea, I only use backend JS. lol
I have a feeling it has to do with the alert() being in the callbacks. Chrome tries to prevent spamming alert()?


RE: Help with each() function - $ninja - 09-22-2015

(09-22-2015, 03:40 AM)Dijkstra Wrote: No idea, I only use backend JS. lol
I have a feeling it has to do with the alert() being in the callbacks. Chrome tries to prevent spamming alert()?

Perhaps. But it doesn't really matter since I only use alert() for quick debugging anyways.


RE: Help with each() function - $ninja - 09-24-2015

Edit: Fixed with hasOwnProperty.