Skip to content

Instantly share code, notes, and snippets.

@h2ospace
Created March 14, 2013 19:42
Show Gist options
  • Save h2ospace/5164520 to your computer and use it in GitHub Desktop.
Save h2ospace/5164520 to your computer and use it in GitHub Desktop.
underscore: range, random, escape, times
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Underscore</title>
<script src="underscore-min.js"></script>
</head>
<body>
<script>
(function() {
var x;
x = _.range(1, 11);
x = _.range(11);
x = _.range(1, 11, 2);
x = _.random(10);
x = _.random(3, 10);
x = _.escape('<script>');
_.times(5, function() {
console.log('hello');
});
console.log(x);
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment