Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:30:43+00:00 2026-06-03T19:30:43+00:00

Excuse the beginner question, but I’m having difficulty wrapping my head around this. Using

  • 0

Excuse the beginner question, but I’m having difficulty wrapping my head around this. Using jquery I can do something like this:

$.each(array, testF); 

function testF(){
    console.log(this.name);  
}

Using $.each I can pass the array to the the function testF, and access the object contained within each row of the array. But when I try to do something like:

array[0].testF()

I get an error stating that the Object has no method ‘testF’. I’m wondering if someone can explain what’s happening here… why the jQuery one works, but the second doesn’t. Again, please excuse the beginner question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:30:48+00:00Added an answer on June 3, 2026 at 7:30 pm
    • $.each(array, testF) calls testF(i, elem) for each element in the array with this bound to elem.
    • array[0].testF() tries to call a method testF() that exists on array[0]

    The equivalent of what $.each() does is testF.call(array[0], 0, array[0]) or since you do not use the arguments you can simpl do testF.call(array[0])

    See MDN for the documentation of .call().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Excuse the beginner level of this question. I have the following simple code, but
Excuse me if this is a silly question but i'm a beginer here. I
excuse what seems like a real noobie question but how can I implement the
I'm new to both ajax and jquery, so please excuse the beginner question. I'm
Excuse what is probably a really basic question but how do I achieve this.
I'm not sure if this is a beginner's question, so excuse me if it
Please excuse me if this is a very novice question, but I am little
Excuse my ignorance but I'm having a tough time figuring this out. I'm trying
Excuse me if this is an obvious question, How can you use SWFobject to
Excuse my emacs newbiness here, but does anybody know how to get around this?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.