I am using a platform that only supports ECMAScript 5, and therefore my JavaScript code must work within that limit. Randomize is just a helper function I’ve written. This code snippet works perfectly in an environment that supports never versions than ecmascript 5, but it does not work in an ecmascript 5 environment. The function Array.find does not exist in ecmascript 5. How can I make it work in Ecmascript5?
Thanks in advance!
This is the code:
Array.from(crypto.getRandomValues(new Uint32Array(16))).map(randomize).join(‘’)
Since u can not use the function,i think u can rewrite a period of code of function that can help u reach the same condition. here are my private method from other developers:
function arrayFrom (){
let args = Array.prototype.slice.call(arguments);
return args
};
arrayFrom(1,2,3)// printf: [1,2,3]