drkthng
drkthng

Reputation: 6929

What does "eq" in the jquery .eq() method stand for?

example:

$("td:eq(2)").css("color", "red"); or
$('td').eq(2).css("color", "red");

I want to know what the abbreviation "eq" stands for, I am not asking what the .eq() method does, which can be found here.

Regarding the importance of the question: I myself find it easier to learn a language, when I know what certain abbreviations really stand for. And I also sometimes "read" my written code aloud using "real" words.

Upvotes: 47

Views: 8596

Answers (4)

geoyws
geoyws

Reputation: 3687

I think of it as *e*lement *q*ueue.

Upvotes: 5

Plynx
Plynx

Reputation: 11461

eq() makes sense if you know it's part of a related set of selectors (from the JQuery docs):

The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them.

When lined up next to lt (less than), and gt (greater than), it's clear that it means equals, specifically "index equals n".

Upvotes: 68

Matt Ball
Matt Ball

Reputation: 359956

I have always assumed that .eq() is short for "equals." Many (perhaps even most) common English-language words that start with "eq" have the equi- prefix, rooted in the Latin word for "equals."

Upvotes: 22

andri
andri

Reputation: 1021

i always think eq is short of sequence :)

Upvotes: 1

Related Questions