• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic Javascript question

 
Ranch Hand
Posts: 112
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Can someone please tell me what the following statments mean? Im totally confused



I know that these are basic js questions. But Im really not able to comprehend these things here. Im very much new to js . Please suggest.

Thanks,
Pavan.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. No the function is not called by this statement. Functions are first class objects in JavaScript so references to them can be passed around. Here, the actionCall property is being assigned as a reference to the function.

2. tbody sounds like it's a reference to a tbody element, so this is simply traversing the DOM tree. (Would be lots and lots easier using jQuery.)

3. Yes.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tbody.firstChild.lastChild.firstChild

Start with a tbody element
first child of the tbody would be the first tr element
last child of the tr would be the last cell [td or th]of the table
first child of the cell would be the first element in it.

Eric

 
There is no "i" in denial. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic