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,219
  • 2
  • 12
  • 24
Tukadas
  • 73
  • 2
  • 9

1 Answers1

1

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

AndrejH
  • 1,710
  • 10
  • 20