Skip to content

Instantly share code, notes, and snippets.

@LuisMDeveloper
Created April 25, 2014 22:22
Show Gist options
  • Save LuisMDeveloper/11305149 to your computer and use it in GitHub Desktop.
Save LuisMDeveloper/11305149 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
var Tuts = [
{name : 'NetTuts', niche : 'Web Development', visitors: 23 },
{name : 'WPTuts', niche : 'WordPress', visitors: 35 },
{name : 'PSDTuts', niche : 'PhotoShop', visitors: 34 },
{name : 'AeTuts', niche : 'After Effects', visitors: 46 }];
var niches = _.pluck(Tuts, 'niche');
console.log(niches);
var names = _.pluck(Tuts, 'name').map(function (value) { return value + "+" ;});
console.log(names);
var selectedValues = _.map(Tuts, function (page) {
return { name: page.name, visitors: page.visitors };
});
console.log(selectedValues);
var Scores = [95, 82, 98, 78, 65];
var hasPassed = _(Scores).all(function (value){return value>50; });
console.log(hasPassed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment