TypeScript-Handbook icon indicating copy to clipboard operation
TypeScript-Handbook copied to clipboard

Review Basic Types for language changes

Open RyanCavanaugh opened this issue 10 years ago • 2 comments

Update this file so that it is up-to-date with regard to new language features, especially around union types and ES6 features

RyanCavanaugh avatar Apr 10 '15 18:04 RyanCavanaugh

When accessing an element outside the set of known indices, a union type is used instead:

If I understand correctly this line in Basic Types > Tuple is no longer valid.

tulushev avatar Nov 15 '18 10:11 tulushev

Hi: As what handbook said:

However, when using the --strictNullChecks flag, null and undefined are only assignable to void and their respective types.

I tested this locally and it didn't work as what I expected. null cannot assigned to void ?

Example:

let nullValue: void = null;

xiaojingzhao avatar Feb 26 '19 02:02 xiaojingzhao