Skip to content

Instantly share code, notes, and snippets.

@ehsanghaffar
Last active November 23, 2022 06:34
Show Gist options
  • Save ehsanghaffar/1aaad46464fa2b19475e005234785bb4 to your computer and use it in GitHub Desktop.
Save ehsanghaffar/1aaad46464fa2b19475e005234785bb4 to your computer and use it in GitHub Desktop.
Typescript code snippets
const add = (a: number, b: number): number => a + b
add('1', '2')
// ❌ این ارور زیر رو برمیگردونه
// Argument of type 'string' is not assignable to parameter of type 'number'. ts(2345)
add(1, 2).replace('0', '*')
// ❌ این ارور زیر رو برمیگردونه
// Property 'replace' does not exist on type 'number'. ts(2339)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment