2

I am debugging a complex javascript and I came across a line:

 (this.kq.hu || nq.hq)(uu);

hu and hq are both functions and uu is a variable(if Im correct)

I tried to find out what this line of code does for the past hour with no luck.

Does anybody know what exactly this line of code does?

I think this is something very small.. but I do not get it after giving it a thought.

You can find the full js here: http://pastebin.com/n6rXT7sf

Its line# 35

2 Answers 2

4

It's the equivalent of this:

if (this.kq.hu) {
  this.kq.hu(uu);
} else {
  nq.hq(uu);
}

Translated: if this.kq.hu exists, call it with parameter uu, otherwise call nq.nq with the same parameter.

Sign up to request clarification or add additional context in comments.

Comments

1

if (this.kq.hu === null || this.kq.hu === undefined) function nq.hq will run, else this.kq.hu will run with parameter uu.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.