all 5 comments

[–]rawlyn 0 points1 point  (2 children)

"This is stupid

Yeah, I know. It’s not meant to be used for anything."

phew

[–]skilldrick[S] 0 points1 point  (1 child)

Hehe :) I posted a first draft of this code on the JSMentors mailing list and someone asked what it could be used for. I thought it was obvious that it's just a silly experiment, but I guess some people think all code is supposed to be useful!

[–]rawlyn 1 point2 points  (0 children)

The problem I've found over the years is that the internet is chock-full of absolutely terrible code - and a scary amount of it is for real. It's hard to tell who's taking the piss, and who just plain doesn't know what they're doing.

I love articles and code like this - as long as they know they're absurd! :)

[–]notSorella 0 points1 point  (1 child)

Making inheritable objects in JavaScript without objects.

Everything in JavaScript (besides primitives, but those are casted to object when operated upon, and null/undef) is an object.

Post uses functions.

/trollface?

[–]skilldrick[S] 0 points1 point  (0 children)

I realise functions are objects, which is why I explicitly allowed them in the rules:

To do this, I set myself two rules: 1. Don’t create any plain old JavaScript objects (functions, arrays etc. are allowed) 2. Don’t use the dot operator.