Callionica on Nostr: Is it possible that you’re confusing cast syntax with generic argument passing ...
Is it possible that you’re confusing cast syntax with generic argument passing syntax?
`<type>fn()` is a cast to `type`.
`fn<type>()` passes `type` as a generic argument.
You’re getting `number` because you’re casting to `number` (Typescript calls this a “type assertion”)
Published at
2024-06-20 08:22:41Event JSON
{
"id": "460284c302bea2b09d84bbc9b6a2f6f6516efe15ce4ed3d0b5f0167f66eb7689",
"pubkey": "ceee9d7e6705946321b940eb4ec4db738c18362d2ac26d89c9eaaf9269c7fe0b",
"created_at": 1718871761,
"kind": 1,
"tags": [
[
"p",
"692d9d8fb6c5db3d114c21513be89063e8ee0d14f89d35103c8f1b7d40a116a7"
],
[
"e",
"9ef941bdeb7154ba9c9e191c9be759f2c20d9e833738f2e99d38704d3e4f3b9a",
"",
"root"
],
[
"proxy",
"https://mastodon.social/@callionica/112647979748522252",
"web"
],
[
"proxy",
"https://mastodon.social/users/callionica/statuses/112647979748522252",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/callionica/statuses/112647979748522252",
"pink.momostr"
]
],
"content": "Is it possible that you’re confusing cast syntax with generic argument passing syntax?\n\n`\u003ctype\u003efn()` is a cast to `type`. \n`fn\u003ctype\u003e()` passes `type` as a generic argument. \n\nYou’re getting `number` because you’re casting to `number` (Typescript calls this a “type assertion”)",
"sig": "5abb6aca6114964e341feb6bc92059364f0e56721c9f4dd1731ca36dd0761ab37a3afdfd58928fa77ed7758780514bb678838981b152e44666ea8da699877dd4"
}