Skip to content

Instantly share code, notes, and snippets.

@ara-ta3
Last active July 5, 2020 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ara-ta3/ebe35eaef766f1ecacc63a3c8473ba61 to your computer and use it in GitHub Desktop.
Save ara-ta3/ebe35eaef766f1ecacc63a3c8473ba61 to your computer and use it in GitHub Desktop.
JavaScriptワンライナーまとめスレ

ワンライナーまとめスレ

((code) => [code.replace("#", "")].flatMap((s) => [s[0] + s[1], s[2] + s[3], s[4] + s[5]]).map((c) => parseInt(c, 16)))("#ffffff")
// prettier
((code) =>
[code.replace("#", "")]
.flatMap((s) => [s[0] + s[1], s[2] + s[3], s[4] + s[5]])
.map((c) => parseInt(c, 16)))("#ffffff");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment