K
K
kotia2011-09-03 01:13:34
JavaScript
kotia, 2011-09-03 01:13:34

Operator "?" in javascript?

I'm trying to figure out the jquery.address library.
The documentation there is lame on both legs, so I smoke the source code of the examples.

And there often comes across an operator (is it an operator?) in the form of a question mark, which I hear about for the first time. For example:

result.push(i + ': ' + (typeof val == 'object'? val.join? '\'' + val.join(', ') + '\'': serialize(val) : '\'' + val + '\''));

var match = links.length? links.shift() + ' ' + links.join('.'): 'Home';

Etc. Source: www.asual.com/jquery/address/samples/api/

What does this operator do?

And, taking the opportunity, do you know of any alternative ajax addressing tools? Or at least on what request to look for them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marcus, 2011-09-03
@marcus

Well guys. Ternary operator is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question