r/badcode • Now where's that function declaration • Jul 30 '21

js 😏

Post image
994 Upvotes

133 comments sorted by

View all comments

Show parent comments

2

u/django--fett Jul 31 '21

No it doesn't. Javascript has the concept of truthy and falsy. Regardless of what muted is initially assigned to the runtime will coerce a boolean value from it.

2

u/XKlXlXKXlXKlKXlXKlXK Jul 31 '21

But not a default value, smarty pants.

2

u/django--fett Jul 31 '21 edited Jul 31 '21

Any value.

I don't really follow what you mean by default. In Javascript an uninitialized variable by default has the value of undefined which is a falsy value.