JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Share
Explore
Like all truely great Love Poetry, Shakespeare is best appreciated in the original JavaScript formulations:
// A Love Poem in JavaScript
function proclaimLove(heart, soul) {
const thou = {
beauty: "infinite",
grace: "endless",
// Thy eyes, like stars, do twinkle bright,
eyes: function() {
return "stars twinkling in the night";
},
// Thy smile, a beacon, pure delight,
smile: function() {
return "a beacon of pure delight";
}
};
// If love be an array, thou art my element at index zero
const loveArray = ["thee"];
if (loveArray.indexOf(thou) === -1) {
loveArray.push(thou);
}
let affection = "true";
while (affection === "true") {
heart += thou.eyes() + " ";
soul += thou.smile() + " ";
affection = "eternal";
}
return `My heart, my soul, they sing for thee,
In loops of love, eternally.`;
}
console.log(proclaimLove("heart:", "soul:"));
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.