Return to Snippet

Revision: 65864
at January 31, 2014 15:58 by asimmittal


Initial Code
define([],function(){
    var pool = ['a','b','c','d'];
    var Random = function(){
        
        this.getRandomString = function(N){
            var strToReturn = "";
            for(var i = 0; i < N; i++){
                var indexToPick = Math.floor((Math.random()*pool.length));
                strToReturn += pool[indexToPick];
            }
            
            return strToReturn;
        };
    };
    
    
    return Random;
});

Initial URL

                                

Initial Description
This is part 1 of the requireJS tutorial

Initial Title
JS part 1 - requireJS Tutorial

Initial Tags

                                

Initial Language
JavaScript