function js_random_key_generator(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for ( var i = 0; i < length; i++ ) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } console.log(js_random_key_generator(10));Related Keywords: Developer, How-to, Solved, HTML, CSS, JS, Function, Script
喜歡這篇文章嗎?
(暫時未有評分)
Loading...
(暫時未有評分)
Loading...