Created
December 6, 2014 07:09
-
-
Save prio101/2b093b340435a929f823 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/vewuso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; | |
} | |
} | |
console.log(firstComplete); | |
</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; | |
} | |
} | |
console.log(firstComplete);</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
console.log(firstComplete); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment