JSFiddle - React, Tailwind, and code Playground

by Josh Pullen

JavaScript

const linesOfCode = [
  "const linesOfCode = [",
  "];",
  "",
  "console.log(",
  "  (linesOfCode[0] + \"\\n\") +",
  "  (linesOfCode.map(line => `  ${JSON.stringify(line)},`).join(\"\\n\")) + \"\\n\" +",
  "  (linesOfCode.slice(1).join(\"\\n\"))",
  ");",
];

console.log(
  (linesOfCode[0] + "\n") +
  (linesOfCode.map(line => `  ${JSON.stringify(line)},`).join("\n")) + "\n" +
  (linesOfCode.slice(1).join("\n"))
);