Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var cleverBrace = function(prefix, suffix, n, result) {
if (n % 2 !== 0) return;
if (n == 2) {
var val = prefix + "()" + suffix;
if (result.indexOf(val) === -1) {
result.push(val);
}
} else if (n > 2) {
cleverBrace(prefix + "(", ")" + suffix, n - 2, result);
cleverBrace(prefix + "()", suffix, n - 2, result);
var createPassowrd = function(){
var password = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@!_0123456789";
for( var i=0; i < 9; i++ )
password += possible.charAt(Math.floor(Math.random() * possible.length));
return password;
};