Skip to content

Commit 5cb73d5

Browse files
committed
Add random filter.
1 parent a59c9f2 commit 5cb73d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

filter-random.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Return a random item in a supplied array
3+
* @param {array} array
4+
* @return {item}
5+
*/
6+
PolymerExpressions.prototype.random = function(array){
7+
return array[Math.floor(Math.random() * array.length)];
8+
}

0 commit comments

Comments
 (0)