Skip to content

Instantly share code, notes, and snippets.

@NimJay
Last active February 2, 2020 00:50
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 NimJay/144c26abad3e05ffccd3f2e54e29dbcb to your computer and use it in GitHub Desktop.
Save NimJay/144c26abad3e05ffccd3f2e54e29dbcb to your computer and use it in GitHub Desktop.
{
let things = [];
let thingsElement = $0.children; // Select the DOM element that contains the list.
for (let i = 0; i < thingsElement.length; i++) {
const thing = thingsElement[i].children[1].innerHTML; // Change this. Extract the item from its HTML element.
things.push(thing);
}
let glue = "\",\n \""; // Change this.
console.log(things.join(glue));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment