Choosen: Komisches Javascript Phänomen

Beitrag lesen

Jetz müssts gehn ;D sry

var JavascripteXtra = function(){  
this.CodierArray =  [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']  
this.mixArray = function(){  
                var _input = arguments[0];  
                if(typeof arguments[1] == "undefined"){  
                        arguments[1] = "1";  
                }  
                var isstring;  
                if (typeof _input == 'string'){  
                        _input = _input.split("");  
                        isstring = true;  
                }  
                for (var i = 0; i < _input.length * arguments[1]; i++){  
                        mix1 = Math.round(Math.random() * (_input.length - 1));  
                        mix2 = Math.round(Math.random() * (_input.length - 1));  
                        buffer = _input[mix1];  
                        _input[mix1] = _input[mix2];  
                        _input[mix2] = buffer;  
                }  
                if (isstring){  
                        return _input.join("");  
                }  
                        return _input;  
        }  
		}  
var jX = new JavascripteXtra();  
  
alert(jX.CodierArray)  
alert(jX.mixArray(jX.CodierArray,10))  
alert(jX.CodierArray)