Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://documentcloud.github.io/underscore/underscore-min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
  <h1>Speakers</h1>
  <ul></ul>
  
</body>
</html>
 
// Our Data
speakers = ["Graham Morley", "Paul Callaghan",
"Oli Wood","Stefan Dantchev","Richard Powell"];
// Slower
// Slower because it uses $('ul') & .append
// 5 times, 1 for each item in the array
speakers.forEach(function(s) {
  $('ul').append('<li>' + s + '</li>');
});
// Faster
// Faster because it uses $('ul') & .append
// once only
listItems = '';
speakers.forEach(function(s) {
  listItems += '<li>' + s + '</li>';
});
$('ul').append(listItems);
Output 300px

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

Dismiss x
public
Bin info
byrichardpowellpro
0viewers