This project has moved and is read-only. For the latest updates, please go here.

Random() function request

Topics: Extensions
Nov 30, 2009 at 6:34 AM

I always add this function to JSLINQ:

Random: function() {
            var len = this.items.length;
            var index = parseInt((Math.random() * len));
            return this.items[index];


I think it might be useful in many scenarios and it can be added to the official version of JSLINQ.



Oct 25, 2010 at 3:08 PM

Thanks for the suggestion. A ".Random" method has been implemented in the code, and will be in the next update release.