Skip to content

Instantly share code, notes, and snippets.

@darklight9811
Last active August 27, 2021 19:33
Show Gist options
  • Select an option

  • Save darklight9811/0e192a93c02a3464fa182216670e777c to your computer and use it in GitHub Desktop.

Select an option

Save darklight9811/0e192a93c02a3464fa182216670e777c to your computer and use it in GitHub Desktop.
Every alphabet from array extractor
export const getRawWord = (type) =>
({
undefined: "`${[![]][!![] + ![]]}`",
true: "([] + !![])",
false: "([] + ![])",
object: "`${{}}`",
}[type]);
export const getCharacter = (char) =>
({
a: () => `${getRawWord("false")}[!![] + ![]]`,
b: () => `${getRawWord("object")}[!![] + !![]]`,
c: () => `${getRawWord("object")}[!![] + !![] + !![] + !![] + !![]]`,
d: () => `${getRawWord("undefined")}[!![] + !![]]`,
e: () => `${getRawWord("object")}[!![] + !![] + !![] + !![]]`,
f: () => `${getRawWord("false")}[![] + ![]]`,
g: () => {throw new Error("Unavailable character G")},
h: () => {throw new Error("Unavailable character H")},
i: () => `${getRawWord("undefined")}[!![] + !![] + !![] + !![] + !![]]`,
j: () => `${getRawWord("object")}[!![] + !![] + !![]]`,
k: () => {throw new Error("Unavailable character K")},
l: () => `${getRawWord("false")}[!![] + !![]]`,
m: () => {throw new Error("Unavailable character M")},
n: () => `${getRawWord("undefined")}[!![] + ![]]`,
o: () => `${getRawWord("object")}[![] + !![]]`,
p: () => {throw new Error("Unavailable character P")},
q: () => {throw new Error("Unavailable character Q")},
r: () => `${getRawWord("true")}[!![] + ![]]`,
s: () => `${getRawWord("false")}[!![] + !![] + !![]]`,
t: () => `${getRawWord("true")}[![] + ![]]`,
u: () => `${getRawWord("undefined")}[![] + ![]]`,
v: () => {throw new Error("Unavailable character V")},
w: () => {throw new Error("Unavailable character W")},
x: () => {throw new Error("Unavailable character X")},
y: () => {throw new Error("Unavailable character Y")},
z: () => {throw new Error("Unavailable character Z")},
}[char]);
const getWord = (word) => word.split("").map(c => getCharacter(c)()).join(" + ")
export default getWord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment