Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
const poem = (
  word1_1,  
  word1_2,
  word2_1,
  word2_2,
  line3param,
  line4param
) => {
  const line1 = `${word1_1 || 'Roses'} are ${word1_2 || 'red'}.\n`;
  const line2 = `${word2_1 || 'Violets'} are ${word2_2 || 'blue'}.\n`;
  const line3 = `${line3param || 'Sugar is sweet'}.\n`;
  const line4 = `${line4param || 'And so are you'}.`;
  return line1 + line2 + line3 + line4;
}
const myPoem = poem(
  'Dandelions',
  'yellow',
  'Boogers',
  'green',
  'I\'m a nice fellow',
  'Whose nose is squeaky clean'
);
console.log(poem());
console.log(myPoem);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers