Just wait until NaN is not NaN.
Just wait until NaN is not NaN.
Fight me
I'm sorry to hear that 😞
Maybe one day you'll get over it 😜
The error says 'Args is not an irritable' because Args is only any[] by default. Otherwise it is unknown.
And here's some bad examples
```ts
const badExample1: MyObjFn<{ type: number }> = obj => undefined;
const badExample2: MyObjFn<{ type: Record<string, any> }> = obj => undefined;
```
Here's some good examples
```ts
const goodExample1: MyObjFn<{ type: 'any literal value' }> = obj => undefined;
const someObj = { type: 'known type' }
type KnownTypeObj = typeof someObj;
const goodExample2: MyObjFn<KnownTypeObj> = obj => undefined;
```
So, using extends in a generic lets you refine what the minimum matching type can be.
Take this example
```ts
type MyObject = { type: string }
type MyObjFn <T extends MyObject> = (obj: T) => void;
```
You are saying, T must be an object with the property `type` who's value must be a `string`
I had a friend ask if it has something to do with the spread operator.
Sorry bud.
Firstly, that's a rest operator. Secondly, yes, the error is in the function arguments, but it's not a syntax error, it's a type error.
Quiz time!!
Who can tell me what TypeScript error this will give?
Solid explanation. I think of it as more of a filter, like 'this type should extend something, if yes then narrow it down to a type, but if not then it's definitely this other type'
Like, what even is infer?
Just goes to show how much devs do not understand typescript
Depends on your definition of decent. I would say I'm decent. People I've worked with would say 'god tier'. But i know god tier and I'm only decent.
Ooft. Yea BASIC in any form is not great to use. But if someone was like "damn, that BASIC lang looks bussin asf, no cap" I'd slap them, then help them find a project to learn it. Let them find out why it's shit so they know what to avoid next time.
Idk mang. Feels like saying anything is cut and dry when it comes to learning is reductive for how people learn. Maybe explain the differences of the languages and see what excites them?
An excited learner goes deeper, in my experience 🤷
I was today years old when i found out ECMAScript is the standard. JavaScript is an implementation, just like ActionScript.
Damn. Can't believe Oracle thinks I'm a pirate. 🏴☠️
I've not tried bun, but i imagine it has it's own way of doing things that depend on either npm packages or bun's apis. Either way i bet it's not simple or cover enough situations, or we'd all be using it.
#whingemoan
The only useful future ecma standard i see is type annotations. Where we can just ignore ts compiling and still get types/functional code. But i assume this will ignore some type annotations because of compatibility with ecmaScript.
Webpack requires a phD. Vite breaks linters and ignores type errors. Deno droped support for bundling. Esbuild dropped modern build options.
I find the tools very annoying as well. TSC does everything but bundle. Webpack does bundles but you need loaders for TS. Future es api support requires ditching ts for babel. All of these are inconsistent with the es module standard. And there's no simple, do everything bundler/compiler.
Seconded. Also, make `cosnt` keyword valid es6.
I'd just like to interject for a moment. What you're referring to as JavaScript, is in fact, ECMA-262, or as I've recently taken to calling it, ECMAScript 6.
Not a framework, but if i ever have to work with sales force commerce cloud again, I'll use thanosjs.org with it.