== Why is this an issue?

The ``++typeof++`` operator returns a string indicating the type of its argument, and the set of returned values is limited:

* ``++"undefined"++``
* ``++"boolean"++``
* ``++"number"++``
* ``++"string"++``
* ``++"symbol"++`` (since ECMAScript 2015)
* ``++"function"++``
* ``++"object"++`` (for ``++null++`` and any other object)
* ``++"bigint"++`` (since ECMAScript 2020)

Compare a ``++typeof++`` expression to anything else, and the result will always be ``++false++``.

[source,javascript,diff-id=1,diff-type=noncompliant]
----
function isNumber(x) {
  return typeof x === "Number"; // Noncompliant: the function always returns 'false'
}
----

Instead, make sure you are always comparing the expression against one of the seven possible values.

[source,javascript,diff-id=1,diff-type=compliant]
----
function isNumber(x) {
  return typeof x === "number";
}
----

== Resources
=== Documentation

* MDN web docs - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof[typeof]
* MDN web docs - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#primitive_values[Primitive values]
