1

For most of you most probably a trivial question... What is the meaning of question mark in this code?

var pageQuery = parseInt(req.query.page);
var pageNumber = pageQuery ? pageQuery : 1;

If somebody could hand me over some reference also would be appreciated, as I could not find much about it. Thank you.

Sudhir Ojha
  • 3,247
  • 3
  • 14
  • 24
Tukadas
  • 83
  • 2
  • 9

1 Answers1

1

Its called a ternary operator. Here's a reference.

AndrejH
  • 2,028
  • 1
  • 11
  • 23