Created
April 27, 2025 15:31
-
-
Save davidystephenson/a6193d8d763dbc988bdda27231718338 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const message: string = 'goodbye' | |
const count: number = Math.random() | |
const accurate: boolean = count > 0.5 | |
const teacher: 'David Y. Stephenson' = 'David Y. Stephenson' | |
console.log(teacher.length) | |
const a = 1 as number | |
const b: any = 2 | |
const c = a + b | |
// any, unknown, never | |
const x: any = [1, '2', true] // BAD | |
console.log(x.toExponential()) | |
const y: unknown = 1 // GOOD | |
console.log(y as number + a) | |
function crash () { | |
throw new Error('The program needs to stop!') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment