Question about question mark in JavaScript

J

Jimolo

Hi

What does a questionmark before a variable do?

For instance,

var test1 = ''

var test2 = '?test1'

What does it do?
 
T

The Natural Philosopher

Richard said:
In what context do you mean this?
Normally I would say its a query after an URL like;
three meanings in my 'bible'

the one you stated..URL stuff.

Then teh normal C style compact condtional as in

a=(b==c)?d:e;

(if b equals c, set a to d, else set a to e)

Or a part of a regexp pattern matching string thing.
 
G

Gregor Kofler

Jimolo meinte:
Hi

What does a questionmark before a variable do?

For instance,

var test1 = ''

var test2 = '?test1'

What does it do?

Here? test2 contains the string "?test1". There is no "question mark
before a variable".

Gregor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top