1

Can anyone please explain the below code snippet in javascript

this.config.min = undefined != configuration.min ? configuration.min : 0; 
1
  • Its a ternary condition. Commented Aug 6, 2014 at 18:20

1 Answer 1

5

It is a ternary condition. Its like:

if (configuration.min != undefined)
{
    this.config.min = configuration.min;
}
else
{
    this.config.min = 0;
}
Sign up to request clarification or add additional context in comments.

2 Comments

@Karthikeyan nice, glad to help.
:min: undefined != min ? min : 0, does the above line also means the same as u explained earlier

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.