Advertisement ยท 728 ร— 90

Posts by

Just wait until NaN is not NaN.

5 months ago 0 0 0 0

Fight me

5 months ago 0 0 1 0

I'm sorry to hear that ๐Ÿ˜ž
Maybe one day you'll get over it ๐Ÿ˜œ

9 months ago 1 0 0 0

The error says 'Args is not an irritable' because Args is only any[] by default. Otherwise it is unknown.

1 year ago 0 0 0 0

And here's some bad examples

```ts
const badExample1: MyObjFn<{ type: number }> = obj => undefined;
const badExample2: MyObjFn<{ type: Record<string, any> }> = obj => undefined;
```

1 year ago 0 0 0 0

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;
```

1 year ago 0 0 1 0

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`

1 year ago 0 0 1 0

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.

1 year ago 0 0 1 0
Post image

Quiz time!!

Who can tell me what TypeScript error this will give?

1 year ago 1 0 2 0
Advertisement

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'

1 year ago 0 0 0 0

Like, what even is infer?

1 year ago 0 0 1 0

Just goes to show how much devs do not understand typescript

1 year ago 1 0 1 0

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.

1 year ago 0 0 1 0

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.

1 year ago 1 0 1 0

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 ๐Ÿคท

1 year ago 0 0 1 0

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. ๐Ÿดโ€โ˜ ๏ธ

1 year ago 4 0 0 0

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.

1 year ago 0 0 0 0

#whingemoan

1 year ago 0 0 0 0

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.

1 year ago 0 0 1 0
Advertisement

Webpack requires a phD. Vite breaks linters and ignores type errors. Deno droped support for bundling. Esbuild dropped modern build options.

1 year ago 0 0 0 0

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.

1 year ago 1 0 3 0
Preview
a close up of a woman 's face with a hat on her head . ALT: a close up of a woman 's face with a hat on her head .

First time, every time ๐Ÿค™

1 year ago 1 0 0 0
Preview
a man in a plaid shirt is crying with the words wait wait wait wait ALT: a man in a plaid shirt is crying with the words wait wait wait wait

THE SECOND ONE

1 year ago 1 0 1 0
Preview
a cartoon of a blue cat wearing a yellow shirt with cool cats written on it ALT: a cartoon of a blue cat wearing a yellow shirt with cool cats written on it

Uhhhhh... The first one?

1 year ago 0 0 0 0

Seconded. Also, make `cosnt` keyword valid es6.

1 year ago 0 0 0 0

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.

1 year ago 2 0 0 0
Thanos JS A demo site to use with Netlify Drop

Not a framework, but if i ever have to work with sales force commerce cloud again, I'll use thanosjs.org with it.

1 year ago 0 0 0 0
Advertisement
Post image
1 year ago 0 0 0 0