Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
annoyingconst92
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
21 ms
·
1.
▲
by
annoyingconst92
6y ago
The problem is that, when prototyping and iterating a design I often don't know in advance what should be private or const and what shouldn't be. And when interactively experimenting in the DevTools console I often want to redef
2.
▲
by
annoyingconst92
6y ago
If you are the one writing entirely new code then you can choose to do that. But if you must build upon the work of a different programmer who is not you and that programmer chose `class Foo{}` instead of `Foo=class{}` then the code
3.
▲
by
annoyingconst92
6y ago
Good tip, thanks, but it means that code written like class A {} has a huge difference from code written like A = class {} In classical JavaScript consider how small the difference is between function foo () {} and
4.
▲
by
annoyingconst92
6y ago
> Of course you can't redefine it. Well, you can redefine it by editing its source code file on disk. (Unless the file is read-only.) But it's a lot faster to be able to redefine it interactively inside the DevTools console and
5.
▲
by
annoyingconst92
6y ago
Except `const` ruins interactive rapid prototyping using the browser DevTools console. If `width` was declared `const width = 800` you can't interactively experiment by setting `width=1024` because you get `..TypeError: Assignment to c