's Avatar

@codelo-time

21
Followers
38
Following
28
Posts
05.12.2024
Joined
Posts Following

Latest posts by @codelo-time

Just wait until NaN is not NaN.

15.11.2025 11:57 👍 0 🔁 0 💬 0 📌 0

Fight me

09.11.2025 02:34 👍 0 🔁 0 💬 1 📌 0

I'm sorry to hear that 😞
Maybe one day you'll get over it 😜

19.06.2025 11:10 👍 1 🔁 0 💬 0 📌 0

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

24.01.2025 23:42 👍 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;
```

24.01.2025 23:39 👍 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;
```

24.01.2025 23:38 👍 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`

24.01.2025 23:38 👍 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.

23.01.2025 02:06 👍 0 🔁 0 💬 1 📌 0
Post image

Quiz time!!

Who can tell me what TypeScript error this will give?

23.01.2025 01:02 👍 1 🔁 0 💬 2 📌 0

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'

21.01.2025 04:02 👍 0 🔁 0 💬 0 📌 0

Like, what even is infer?

21.01.2025 03:36 👍 0 🔁 0 💬 1 📌 0

Just goes to show how much devs do not understand typescript

21.01.2025 03:35 👍 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.

20.01.2025 22:04 👍 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.

20.01.2025 21:49 👍 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 🤷

20.01.2025 21:41 👍 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. 🏴‍☠️

10.01.2025 07:02 👍 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.

29.12.2024 08:13 👍 0 🔁 0 💬 0 📌 0

#whingemoan

29.12.2024 08:09 👍 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.

29.12.2024 08:08 👍 0 🔁 0 💬 1 📌 0

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

29.12.2024 08:04 👍 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.

29.12.2024 08:01 👍 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 🤙

13.12.2024 10:02 👍 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

13.12.2024 09:59 👍 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?

13.12.2024 09:58 👍 0 🔁 0 💬 0 📌 0

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

13.12.2024 09:47 👍 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.

13.12.2024 09:41 👍 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.

13.12.2024 09:35 👍 0 🔁 0 💬 0 📌 0
Post image
10.12.2024 21:43 👍 0 🔁 0 💬 0 📌 0