0

I know jQuery.fn is just an alias of jQuery.prototype, but what does "fn" stand for? Does it have a full name?

For example, "formal name"? "formal namespace"? I've no idea.

3
  • It is shorthand for function.
    – Undefined
    Commented Jul 18, 2012 at 13:02
  • 2
    I'll add that in Basic, to define a function you wrote DEF FN :-)
    – xanatos
    Commented Jul 18, 2012 at 13:04
  • @xan Obvious connection, since jQuery compiles down to BASIC... ;o)))
    – deceze
    Commented Jul 18, 2012 at 13:05

2 Answers 2

5

fn as in f unctio n.

It is also the name of the formal parameter wherever a function is expected:

// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
5
  • They named it fn whoopee, but you can easily rename it. it does not have to be called fn
    – Naftali
    Commented Jul 18, 2012 at 13:12
  • @Neal ? The op asked what does "fn" stand for, and it stands for the word "function"
    – Esailija
    Commented Jul 18, 2012 at 13:13
  • Also why couldn't it be fn as in f u n ction? :-P
    – Naftali
    Commented Jul 18, 2012 at 13:14
  • @Neal I don't know, I just made it up
    – Esailija
    Commented Jul 18, 2012 at 13:14
  • Thanks Esailija for your help :) Commented Jul 18, 2012 at 13:26
2

jQuery.fn is just an alias for jQuery.prototype (which just saves us time when coding such jQuery.fn.init.prototype = jQuery.fn = $.fn as such).

If you remember about prototypes functions in JavaScript Objects, then it would make total sense.

Remember, JQuery itself is an object.
This article can help you to better understand.

1
  • Thanks philippe, probably it's a shorthand for "function", but is there any official document for this information? Or, is it conventional? Commented Jul 18, 2012 at 13:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.