
Perl write-only vs. Js write-only
This little JavaScript by Yosuke Hasegawa fulfills alert (1):
(É = [Å = [], µ =! Å + Å] [µ [È = - ~ - ~ ++ Å] + ({} + Å) [Ç = !! Å + μ, ª = Ç [Å] + Ç [+! Å], Å] + ª]) () [μ [Å] + μ [Å + Å] + Ç [È] + ª] (Å )
How does it work?
For simplicity, replace
Å -> Int_1
É -> f_sort
È -> Int_3
µ -> B_false
ª -> Str_rt
Ç -> Str_truefalse
We get :
(f_sort = [Int_1 = [], B_false =! Int_1 + Int_1] [B_false [Int_3 = - ~ - ~ ++ Int_1] + ({} + Int_1) [Str_truefalse = !! Int_1 + B_false, Str_rt = Str_truefalse [Int_1] + Str_truefalse [+! Int_1], Int_1] + Str_rt]) () [B_false [Int_1 ] + B_false [Int_1 + Int_1] + Str_truefalse [Int_3] + Str_rt] (Int_1)
Format:
Everything is simple and clear.
(É = [Å = [], µ =! Å + Å] [µ [È = - ~ - ~ ++ Å] + ({} + Å) [Ç = !! Å + μ, ª = Ç [Å] + Ç [+! Å], Å] + ª]) () [μ [Å] + μ [Å + Å] + Ç [È] + ª] (Å )
How does it work?
For simplicity, replace
Å -> Int_1
É -> f_sort
È -> Int_3
µ -> B_false
ª -> Str_rt
Ç -> Str_truefalse
We get :
(f_sort = [Int_1 = [], B_false =! Int_1 + Int_1] [B_false [Int_3 = - ~ - ~ ++ Int_1] + ({} + Int_1) [Str_truefalse = !! Int_1 + B_false, Str_rt = Str_truefalse [Int_1] + Str_truefalse [+! Int_1], Int_1] + Str_rt]) () [B_false [Int_1 ] + B_false [Int_1 + Int_1] + Str_truefalse [Int_3] + Str_rt] (Int_1)
Format:
-
- (f_sort=
- [
- Int_1 = [],
- B_false = !Int_1 + Int_1 // B_false = ![]+[] = false
- ] // [[],false]
- [
- B_false[
- Int_3 = -~-~ ++Int_1 // ++Int_3 = 3 ([].toInt() -> 0, ++0 = 1, ~1 -> -2, --2 -> 2, ~2->-3, --3 = 3), Int_1 = 1
- ] // 'false'[3] = 's'
- + ({} + Int_1 ) // {} cast to string -> '[object Object]' + 1 -> '[object Object]1'
- [
- Str_truefalse = !!Int_1 + B_false, // !!Int_1 -> true, Str_truefalse = true + false = 'truefalse'
- Str_rt = Str_truefalse[Int_1] + Str_truefalse[+!Int_1], // Str_rt = 'truefalse'[1] + 'truefalse'[0] = 'rt'
- Int_1 // 1
- ]//'[object Object]1'['truefalse', 'rt',1] -> 'o' ('[object Object]1'[1])
- + Str_rt
-
- ]// [][ 's'+'o'+'rt'] -> [].sort
- )() // (f_sort = [].sort)() -> [].sort.call() -> window
- [
- B_false[Int_1]+ // 'false'[1] -> 'a'
- B_false[Int_1+Int_1]+ // 'false'[2] -> 'l'
- Str_truefalse[Int_3]+ // 'truefalse'[3] -> 'e'
- Str_rt // 'rt'
- ] // ['alert']
- (Int_1) // window['alert'](1)
-
Everything is simple and clear.