JavaScript Is Weird (EXTREME EDITION)

preview_player
Показать описание
To offset some of the banana-based JavaScript "weirdness" that's making the rounds, I'm bring you a 40 line JSFuck compiler that turns innocent looking JS into a mess of obfuscated symbols.

=[ 🔗 Links 🔗 ]=

Рекомендации по теме
Комментарии
Автор

JavaScript refusing to crash no matter what two random things you add together has the same energy as being able to kill any npc in new vegas and the story managing to continue on

__
Автор

I was expecting you to compile this compiler in itself at the end, that would have been the cherry on top of this amazing exercise!

ricardoamendoeira
Автор

Finally a good JavaScript tutorial. Was just getting into learning the language. You're a lifesaver

marchmelloow
Автор

Thanks for this. You just ensured my job security for the next 10 years.


Lord have mercy on my replacement.

SlykeThePhoxenix
Автор

I've just discovered your video and thought it'd be funny to make a quine out of it. The resulting file weighs 7MB and is absolutely unreadable. Pretty cool tho.

zealiskander
Автор

ok, not gonna lie
I died when it became obvious that the banana function was outputting a hidden NaN
I never knew that, that's hilarious

Deloxo
Автор

Me after you claiming that all valid JS can be written in JSFuck and that it's really easy to write a JSFuck compiler: "this video better end with a JSFuck compiler compiled to JSFuck, making it self-hosting"

JobvanderZwan
Автор

Well that was genuinely fun in the most nerdiest possible way

dAtramt
Автор

Security advisor: Never store secrets in frontend code!
Me: hold my beer.

jasarwadlow
Автор

Storing this as obfuscated production code on a server would probably lead to faster page loads because although the file is huge, it will be gzipped in transport, and with so few distinct characters and so many repeating patterns it probably compresses really well!

PhoenixClank
Автор

Adding < would allow to optimize the code a lot because it allows bit shifting to the left (<<)
I tried it myself with the word "console" and the code got reduced from 357 characters to 165
Probably could be optimized more because I'm not the sharpest tool in the shed

JustAGenericHero
Автор

Lesson of the day: If you are relying on data structures to protect your data in JS, you are probably not protecting your data.

andythedishwasher
Автор

I'm a beginner in JavaScript and this is just ... Amazing

mer
Автор

I actually was able to do a lot of that myself, but using the function constructor to return escape, and using that to escape the backslash... I would not have been able to come to that conclusion in a million years.

barmetler
Автор

I cackled manically through this whole video. This is the chaotic good we need in the world ❤️

BlasterKat
Автор

I just spent a not insignificant amount of time trying to improve the method for generating capital C. It's really surprisingly difficult. I couldn't find a way that didn't involve using the Function constructor to basically get an eval, after which it's fairly simple.

gormster
Автор

If you had extracted all possible easy letters from your early steps instead of just the bare minimum necessary letters, you could probably make the final code a lot shorter. The insane lengths of code to get the char value of O would be reduced if you'd just used the O in [object Object]

Dunklesteus
Автор

When I sat down at my computer this morning I didn't expect to end up watching a video on how to write a JSFuck compiler

Fantastically presented. I've been a fan of Esolangs since I got in to coding, and always wondered about the finer details of how JSFuck worked

BrainFuck is honestly easier to understand, simply moving around different memory registers and incrementing/decrementing at the bit level

The bizarre malleability of JS lends itself to being exceptionally hard to understand why things are happening without examples like this. Brilliant work

benjii_boi
Автор

The worst part about the banana thing is it's actually one of the few examples of JS being perfectly reasonable.

Автор

I love this because it's like one of those videos where somebody breaks Pokémon gen 1's item bag to execute arbitrary code... except for JavaScript.
This is a JavaScript challenge run.

basicmountaingriff