Console.WriteLine(info);
Console.WriteLine(info);
```js
0.1 + 0.2 // 0.30000000000000004
NaN === NaN // false
typeof null // "object"
[] == ![] // true
"5" + 3 // "53"
```
```js
0.1 + 0.2 // 0.30000000000000004
NaN === NaN // false
typeof null // "object"
[] == ![] // true
"5" + 3 // "53"
```
Why does typeof null === "object" in JavaScript?
Watch 🍿 www.youtube.com/watch?v=HApr...
Why does typeof null === "object" in JavaScript?
Watch 🍿 www.youtube.com/watch?v=HApr...
- Arthur C# Clarke or something
- Arthur C# Clarke or something
My fav typeof movie 😁
My fav typeof movie 😁
(ref: string | undefined): string =>
ref === undefined ? 'DEFAULT' : ref
Do this kind of thing
(ref: string | undefined): string =>
typeof ref === 'string' ? ref : 'DEFAULT'
(ref: string | undefined): string =>
ref === undefined ? 'DEFAULT' : ref
Do this kind of thing
(ref: string | undefined): string =>
typeof ref === 'string' ? ref : 'DEFAULT'
type ExtractedType = Omit<typeof obj[keyof typeof obj], "">
type ExtractedType = Omit<typeof obj[keyof typeof obj], "">
the fix:
const isBrowser = typeof window !== 'undefined';
const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;
const isServer = !isBrowser && !isWebWorker;
the fix:
const isBrowser = typeof window !== 'undefined';
const isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;
const isServer = !isBrowser && !isWebWorker;
[assembly: DebuggerDisplay(@"\{Color = {Color}}", Target = typeof(Pen))]
[assembly: DebuggerDisplay(@"\{Color = {Color}}", Target = typeof(Pen))]
codepen.io/kizu/pen/Eax...
🤯
codepen.io/kizu/pen/Eax...
🤯
typeof x === 'object' && x != null
*sighs*
If anything, JS should contain checks for its _unorthodox_ types as a must.
typeof x === 'object' && x != null
*sighs*
If anything, JS should contain checks for its _unorthodox_ types as a must.
const obj = {
a: {foo: 1},
b: {foo: 3},
};
type ExtractedType = typeof obj[keyof typeof obj];
I want this to yield { foo: number }, but I get { foo: number } | { foo: number } instead.
www.typescriptlang.org/play/#code/M...
const obj = {
a: {foo: 1},
b: {foo: 3},
};
type ExtractedType = typeof obj[keyof typeof obj];
I want this to yield { foo: number }, but I get { foo: number } | { foo: number } instead.
www.typescriptlang.org/play/#code/M...
`x !== undefined && typeof x !== 'function'`
transformed into
`!(typeof x)[7]`
`x !== undefined && typeof x !== 'function'`
transformed into
`!(typeof x)[7]`
chromium-review.googlesource.com/c/v8/v8/+/5218959
chromium-review.googlesource.com/c/v8/v8/+/5218959