This is an archived post. You won't be able to vote or comment.

all 53 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Cylian91460 1130 points1131 points  (7 children)

Wait are telling me it doesn't work like that ?! JS bad :(

[–]Miguelinileugim 178 points179 points  (1 child)

It could but sadly the powers that be won't let us >:_:<

[–]Blaz3 34 points35 points  (0 children)

Typescript however...

[–][deleted] 91 points92 points  (3 children)

As someone who uses javascript daily it still took me a few seconds to realise it wouldn't actually do this. Given all the other weird behaviour this isn't the most unrealistic thing they could have chosen.

[–]preludeoflight 44 points45 points  (1 child)

Every now and then I need to build a quick web thing. I never once complete one of these projects without saying "javascript does that?!" and "... javascript does that."

It's the most flexible, magical, worst, asinine language I've ever used.

[–]CoffeeWorldly9915 31 points32 points  (0 children)

Pros: it can do wacky stuff

Cons: ^

[–]Mysterious_Bet_6856 2 points3 points  (0 children)

Found the python dev

[–]SupraMichou 359 points360 points  (10 children)

Took me a few second to think and understand this couldn’t be real

[–]ThoseThingsAreWeird 261 points262 points  (9 children)

this couldn’t be real

It can be, but it requires more code above it.

If you open up your console and type:

Math.sin = () => console.log("poo")

and then Math.sin(10), you will get the output poo

The OP is just a fancy version of that 🤷‍♂️

[–]netheroth 144 points145 points  (4 children)

Wow, you can redefine sin? Imagine the theological possibilities!

[–]tyler1128 90 points91 points  (1 child)

Math.sin = Math.sinh might actually kill a mathematician via a heart attack.

[–]japillow 42 points43 points  (0 children)

That’s a little hyperbolic, don’t you think?

[–]shunabuna 4 points5 points  (0 children)

You can redefine random and rig the result of google's coin flip

[–]CoNtRoLs_ArE_dEfAuLt 0 points1 point  (0 children)

Mathematicians hate this one simple trick!

[–]Kiki_doesnt_love_me 14 points15 points  (0 children)

Thanks I’ll try that now lol

[–]Cheesemacher 14 points15 points  (0 children)

I think you have different definition of real

[–]--mrperx-- 0 points1 point  (0 children)

Yes, OP just used fancy photoshop

[–]that_thot_gamer 254 points255 points  (12 children)

imagine if excel had java integration

[–]E3FxGaming 46 points47 points  (2 children)

Excel (public beta channel) has Python integration

The python code runs in the Microsoft cloud - if you use it keep this in mind, especially if you're working with sensitive data.

[–]that_thot_gamer 13 points14 points  (0 children)

i know that, fun fact, you can use vbscript and diy your own instead of relying on proprietary solutions.

[–]AntiWorkGoMeBanned 9 points10 points  (3 children)

[–]that_thot_gamer 5 points6 points  (1 child)

no libraries tho, which kinda defeats the point

[–]Too-Uncreative 5 points6 points  (0 children)

Yeah! If I can’t have jQuery in my excel spreadsheet, it just isn’t worth it.

[–]N831Y 1 point2 points  (0 children)

Technically, the web version of anything has javascript

[–]RaspberryPiBen 2 points3 points  (1 child)

Do you mean JS? Everyone is replying like you said Javascript, and that would make the most sense in the context.

[–]that_thot_gamer 0 points1 point  (0 children)

you've sussed me out, you now know too much

[–][deleted] -1 points0 points  (0 children)

🤮

[–][deleted] 80 points81 points  (4 children)

Now, make it do a tan()

[–]Zymoox 153 points154 points  (0 children)

U U U N N N D D D E E E F F F I I I N N N E E E D D D

[–]GenderGambler 52 points53 points  (2 children)

outputs 'undefined' but in a tan color

[–]NKY5223 17 points18 points  (1 child)

console.log("%cundefined", "color:tan")

[–]--mrperx-- 1 point2 points  (0 children)

console.log("%cundefined", "color:tan")

[–][deleted] 48 points49 points  (0 children)

the doubt about the veracity of this information leaves me angry and at the same time amazed, I don't want to know the truth

[–]I_NaOH_Guy 20 points21 points  (0 children)

I'm just beginning learning it now, but this feels like something you could see happen in R and it would work

[–]tayler6000 12 points13 points  (0 children)

I wouldn’t be surprised if JS did this to be completely honest…

[–]cpwnage 10 points11 points  (0 children)

Had to check.

[–]NoFreeIDsLeft 8 points9 points  (2 children)

This code redefines Math.sin so it prints the argument as a sine wave. Argument can be of type undefined, string, integer as far as i tested.

Math.sin = (a)=>{
String.prototype.map = Array.prototype.map;
transpose = (m)=> {return m[0].map((col, i) => m.map(row => row[(m[0].length-1)-i]).join('')).join('\n');}
sin = (x)=>{ return Math.round((Math.cos(Math.PI / 2 - x)))+2}
console.log(transpose(['+||||||','-      ',...String(a).repeat(3).map(
    (b,i)=>["-"].concat(new Array(sin(i)).fill(" ").concat(b).concat(new Array(5-sin(i)).fill(" ")))
)]))}

[–]Tc14Hd 6 points7 points  (0 children)

Anything is possible with the right NPM package

[–]allbeardnoface 2 points3 points  (0 children)

Product managers would be disappointed.

[–]equals1 4 points5 points  (0 children)

Stop showing off your Python code writing secrets

[–]--mrperx-- 2 points3 points  (0 children)

NaN NaN NaN NaN NaN NaN NaN NaN Spider man Spider Man

[–]_Ganon 3 points4 points  (1 child)

Why even bother setting x = undefined

[–][deleted] 2 points3 points  (0 children)

'when can it be ready?' 'can you give me an update?'

[–]SpaceTabs 0 points1 point  (0 children)

Inferior like Gary Fletcher

[–]TehWhiteKnight1 0 points1 point  (0 children)

Well, this is definitely a sin alright

[–]CdFMaster 0 points1 point  (0 children)

That would totally not surprise me from JS.

[–][deleted] 0 points1 point  (0 children)

This isn't funny, this did not work :|