You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when using the --strictNullChecks flag, null and undefined are only assignable to void and their respective types. This helps avoid many common errors. In cases where you want to pass in either a string or null or undefined, you can use the union type string | null | undefined. Once again, more on union types later on.
when --strictNullChecks is on, x2 and x3 should be errors.
Actual behavior:
x1, x2 and x3 are all reporting errors.
(in truth, I don't know if the doc or the implementation is wrong)
The text was updated successfully, but these errors were encountered:
Code
In https://www.typescriptlang.org/play/index.html
Expected behavior:
According to the doc:
https://www.typescriptlang.org/docs/handbook/basic-types.html
when --strictNullChecks is on, x2 and x3 should be errors.
Actual behavior:
x1, x2 and x3 are all reporting errors.
(in truth, I don't know if the doc or the implementation is wrong)
The text was updated successfully, but these errors were encountered: