jquery - Understanding javascript arrays -
I'm quite new to JavaScript, and I'm not sure that I fully understand that with the code snippet below What's happening:
if ($ ("filter-mark"). Length == 0) return; So I understand the if statement, but the part I can not fully understand is $ (". Filter-icon" ) is. Length . After going through the document I am a bit confused. How is $ (".filter-mark") an array? I thought it was just a thing that was a filter-icon class associated with it. I apologize for the original question, but I am very confused with this and it is difficult for Google with punctuation.
This: $ (". Filter-icon") - A < Strong> jQuery function call. The return value is actually not an array, but it does have the length property that is the length of the result of the call The point of the code is whether it is to check whether any element in the dom has a "filter-mark" class.
It is not that Javascript is not unusual for programming in programming, which is for arrays, but which are actually not. Happily, what they will accept many underlying tasks for the real array, are very loose about this, so you can use original protection work to do interesting things with objects, which are just the actual arrays Have been shown for.
Comments
Post a Comment