Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var singleLineString = function(strings) {
  var values = Array.prototype.slice.call(arguments, 1);
  
  // Interweave the strings with the 
  // substitution vars first.
  var output = '';
  for (var i = 0; i < values.length; i++) {  
    output += strings[i] + values[i];
  }
  output += strings[values.length];
  // Split on newlines.
  var lines = output.split(/(?:\r\n|\n|\r)/);
    
  // Rip out the leading whitespace.
  return lines.map(function(line) {
    return line.replace(/^\s+/gm, '');  
  }).join(' ').trim();
};
var me = 'me';
var raggedy = 'raggedy';
var you = 'you';
console.log(singleLineString`So here is us, on the
      ${raggedy} edge. Don't push ${me},
            and I won't push ${you}.`);
console.log('As opposed to this...');
console.log(`So here is us, on the
      ${raggedy} edge. Don't push ${me},
            and I won't push ${you}.`);
Output 300px

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

Dismiss x
public
Bin info
muffinresearchpro
0viewers