Skip to content

Instantly share code, notes, and snippets.

View ehsanghaffar's full-sized avatar
🏠
Working from home

Ehsan Ghaffar ehsanghaffar

🏠
Working from home
View GitHub Profile
// inline function types
const stringify = (value: any): string => JSON.stringify(value)
@ehsanghaffar
ehsanghaffar / functionsTypes.ts
Last active November 23, 2022 06:34
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', '*')
// ❌ این ارور زیر رو برمیگردونه
{"lastUpload":"2020-12-08T00:47:49.235Z","extensionVersion":"v3.4.3"}

Keybase proof

I hereby claim:

  • I am ehsanghaffarii on github.
  • I am ehsanghaffarii (https://keybase.io/ehsanghaffarii) on keybase.
  • I have a public key ASCvE6IUy6OIJig8kqQXATyxQsuFhIwhOVGqHBfm3SKfhgo

To claim this, I am signing this object: