Skip to content

Instantly share code, notes, and snippets.

@ktk
Created November 14, 2012 13:40
Show Gist options
  • Save ktk/4072119 to your computer and use it in GitHub Desktop.
Save ktk/4072119 to your computer and use it in GitHub Desktop.
domo forEach
var domo = require('domo');
var fruits = [];
fruits.push("banana", "apple", "peach");
var document = DOCUMENT({type: "html"},
HTML(
HEAD(
TITLE("bla"),
SCRIPT({src: "/script.js"})
),
BODY(
TABLE(
THEAD( TR( TD("Predicate"), TD("Object"))),
TBODY( fruits.map(function(value, index) {
console.log("I am in map");
console.log("Value: "+value);
console.log("Key: "+index);
return TR(
TD(index),
TD(value)
);
}))
)
)
)).outerHTML;
console.log(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment