Need some help with a javascript problem

Need some help with a javascript problem

Not sure how asynchronous callbacks work. I have code like this:

  
  1. var count = 0;
  2. $('.count').each(function() {
  3. count++;
  4. }
  5. console.log(count);

So would i have to go through each of the elements independently with a traditional for loop in order to get a count to appear correctly? Or would this get the count?

Thanks Love_Struck

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper