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,009
  • 2
  • 11
  • 23
Tukadas
  • 73
  • 1
  • 9

1 Answers1

1

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

AndrejH
  • 1,490
  • 7
  • 19