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i+n+d];[,,,c,,,o,,_,,,,,y,z]=V+0
F=V[E=c+o+n+s+t+r+u+c+t+o+r]
P=(1+e+2+3-4+t)[2]
f=F(r+e+t+u+r+n+_+a+t+o+(0+{})[3])()(3*4+[][E][n+a+(0[E]+0)[9+2]+e])[1]
F(a,a+l+e+r+t+y+a+P+q+P+a+P+q+z)`
[t,r,u,e,f,a,l,s]=!0+[!1];[,n,d,,q,i]=t.a+t
V=[][f+i+n+d];[,,,c,,,o,,_,,,,,y,z]=V+0
F=V[E=c+o+n+s+t+r+u+c+t+o+r]
P=(1+e+2+3-4+t)[2]
f=F(r+e+t+u+r+n+_+a+t+o+(0+{})[3])()(3*4+[][E][n+a+(0[E]+0)[9+2]+e])[1]
F(a,a+l+e+r+t+y+a+P+q+P+a+P+q+z)`
Explanation
Whew. Settle in for a ride here, because this is gonna be a treacherous journey...
I spent a long time trying to figure out how to solve this challenge with length 1—no built-ins (directly, anyway), keywords, or even arrow functions—before realizing that it is easily possible with JSF***, which can evaluate any JavaScript code while avoiding any multi-byte tokens. But a JSF solution would easily be thousands of bytes long, if not tens or hundreds of thousands. Thanksfully, we aren't limited to just ()[]+!
—we have all of ASCII at our disposal!
I decided to start by golfing the essential building blocks of JSF—the characters that can be built up into strings to "unlock more features," so to speak. We can't use strings directly to get characters, as that would require lines of length 3. So instead, we steal a trick from JSF, getting a few chars from literals that can be built up with single-byte tokens:
JSF*** Used here Value Chars unlocked
!![] !0 true true
![] !1 false fals
[][[]] t.a undefined ndi
From these we can expand outward, starting with [].find
, which is a Function object. Converting this to a string function find() { ...
gives us access to c
, o
, space (_
), and parentheses (y
and z
). Perhaps more importantly, we now have access to its constructor
, the Function
function—which, inceptional as it may sound, gives us the ability to execute code by building a string, passing it to Function()
, and then calling the function generated.
I should probably mention the overall method used by the program itself. As of 2015, JavaScript has this really cool feature called "tagged templates," which not only allows unescaped newlines in strings, but also lets us call a function with a string literal directly (in a way; myFunc`abc`;
is roughly equivalent to myFunc(["abc"])
). If we put the function call as the last thing in the program, the general structure will look like this:
code;func`code;func`
All func
has to do then is output its argument, followed by a backtick, then its argument again, and a second backtick. Assuming we have the argument in a
and a backtick stored in f
, we can accomplish this with the code alert(a+f+a+f)
. However, at the moment, we are missing +
and the backtick itself. +
(stored in P
) isn't hard; we steal another trick from JSF, building the string 1e23
, converting to a number, then back to a string, giving "1e+23"
.
Getting a backtick is a bit more complicated. At first, I tried obtaining String.fromCharCode
, but finding a C
turned out to be nearly as difficult. Fortunately, atob
is easy enough to obtain (Function("return atob")()
; b
is generated from 0+{}
, which gives [object Object]
) and can give any ASCII char, if a proper magic string is found. A short script gave me 12A
as one of the options, which can conveniently be found in 12Array
(a bit shorter to generate, thanks to [].constructor[n+a+m+e]
; m
is found in 0 .constructor+0
: "function Number() { ..."
).
Finally, we stick everything together. We assign the backtick to variable f
, but since we can't use it directly in the function string, we instead set variable q
to the letter f
and use that instead. This makes our final string a+l+e+r+t+y+a+P+q+P+a+P+q+z
, or "alert(a+f+a+f)"
. We then feed this to Function()
, feed the our finished code to the result, and voila, we have a JavaScript quine with no more than one char per line!
My head feels terrible at the moment, so please inquire about any mistakes I've made or things I've missed in this explanation, and I'll get back to you after I've had some rest...