0

I do know the ternary operator

but using '?' without colon that's unusual to me

Here is an example:

path?.forEach(id => checkID(id));

O.kamili
  • 9
  • 1
  • 2
  • check [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) – Zac Jan 13 '21 at 13:11
  • It's called [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). – David Jan 13 '21 at 13:11
  • 2
    See also: [What does this symbol mean in JavaScript?](https://stackoverflow.com/q/9549780) – VLAZ Jan 13 '21 at 13:13
  • 2
    See the documentation on MDN about [expressions and operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators) and [statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements). – Sebastian Simon Jan 13 '21 at 13:23

0 Answers0