Sad().stop() ; wtf().start()
-
-
how the did they call .stop() on a mother ucking boolean.
-
oh right, front end engineers.
That fizz buzz topic showed that front end engineers are terrible at programming, this one is just reinforcing it.
-
Monkey patching!
Boolean.prototype.stop = function () { throw new Error('Hammer time!'); }; sad().stop();
-
using System; namespace WTF { public static class WTFExtentions { public static void Stop(this Boolean b) { throw new Exception("Hammer time!"); } } }
Because I can
-
Very true.
[code]
Boolean.prototype.stop = function(){ console.log("ok"); }
var beAwesome = function(){ console.log("awesomified"); }if(sad()===true){
sad().stop();
beAwesome();
}
[/code][code]
ok
awesomified
[/code]so awful.
-
i'm going to start overloading Boolean prototype to include a stop function and then abuse it randomly in code on private projects just to confuse people that might try to rip my stuff off now.
-
-
Also possible:
> firstcall = false false > function sad() { if (firstcall) { firstcall = false; return true; }return { "stop": function() { throw new Error("Hammer time!"); }}; } undefined > sad() === true false > sad().stop() VM1834:2 Uncaught Error: Hammer time! at Object.stop (<anonymous>:2:104) at <anonymous>:2:7 at Object.InjectedScript._evaluateOn (<anonymous>:895:140) at Object.InjectedScript._evaluateAndWrap (<anonymous>:828:34) at Object.InjectedScript.evaluate (<anonymous>:694:21)
-
...
well i stand corrected, i was naive in my initial interpretation, forgetting that the dynamic typing of javascript means it can be ALL OF THE THINGS
-
Holy cow I screwed that transcription up. How did no one catch it saying
sad() === true
=> 'false'? ;-)> firstcall = true true > function sad() { if (firstcall) { firstcall = false; return true; } return { "stop": function() { throw new Error("Hammer time!"); }}; } undefined > sad() === true true > sad().stop() VM190:2 Uncaught Error: Hammer time!
There we go.
-
-
Boolean.prototype.stop = function(){ console.log("ok"); }
I second this motion. I think with a concerted effort we could get this into ECMA7.
-
-
//life motto if(sad()) { sad().stop(); beAwesome(); }
FTFY
Filed under: I can haz job now?, refactoring FTW
-
That's not refactoring because it changes what the program does.
-
-
How did no one catch it saying sad() === true => 'false'?
You may want to recheck your code.
Impeccable timing.Well, off by 7 minutes or so; but still the consecutive post.
-
'Hammer time!'
M.C. Hammer - U Can't Touch This – [00:14..04:34] 04:34
— MCHammerVevoSurprised no one posted this yet.
-
-
do we need to turn down the "put in a thingy if there's a break in the conversation" setting down to 2 days
-
Turn it down to an hour.
-
what? no!
i was disasapoint that it took 4 days to post that song!
-
Enjoy you're
-
-
Yes. I have a history of mixing up those badgers, so I thought I would eliminate the ambiguity. Something about blood flow to my head being restricted by a small hat or something like that.
<My muscle memory couldn't take the abuse and it ran away. It left a note with a whole bunch apostrophes scribbled in the bottom. I have to deal with the surplus somehow>
-
woo!
i shall enjoy it.WITH CUPCAKES!
-
If you want, your hat could be resized. Just be careful what you ask for ...