Skip to content

Instantly share code, notes, and snippets.

@prio101
Created December 6, 2014 07:08
Show Gist options
  • Save prio101/2581045fe0b3a6ab87e6 to your computer and use it in GitHub Desktop.
Save prio101/2581045fe0b3a6ab87e6 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var tasks = [
{name:'Buy milk',complete:false},
{name:'Trash',complete:false},
{name:'Repairs',complete:false},
{name:'Plumber',complete:true}
];
var firstComplete;
for(var i=0;i<tasks.length;i++){
if(tasks[i].complete){
firstComplete = tasks[i];
break;
}
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">var tasks = [
{name:'Buy milk',complete:false},
{name:'Trash',complete:false},
{name:'Repairs',complete:false},
{name:'Plumber',complete:true}
];
var firstComplete;
for(var i=0;i<tasks.length;i++){
if(tasks[i].complete){
firstComplete = tasks[i];
break;
}
}</script></body>
</html>
var tasks = [
{name:'Buy milk',complete:false},
{name:'Trash',complete:false},
{name:'Repairs',complete:false},
{name:'Plumber',complete:true}
];
var firstComplete;
for(var i=0;i<tasks.length;i++){
if(tasks[i].complete){
firstComplete = tasks[i];
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment