How to generate random string in javascript?
In this post we will give you information about How to generate random string in javascript?. Hear we will give you detail about How to generate random string in javascript?And how to use it also give you demo for it if it is necessary.
In this example, i will show you how to generate random string or characters in javascript. We can simply generate random alphanumeric string for token or etc in jquery.
As we know jquery or javascript does not have default random string generate function so we need to create custom js function to create random and unique string in javascript. we will pass length of string and it will return random string. we will use Math.random() function too.
How to revoke 'git add' before 'git commit' ?
In this post we will give you information about How to revoke 'git add' before 'git commit' ?. Hear we will give you detail about How to revoke 'git add' before 'git commit' ?And how to use it also give you demo for it if it is necessary.
Sometimes you need to undo your git file before you git comment command. Because you made a some misteck or wrong code and you did git add using "git add ." command then you think how to undo your code before git commit command. But you can do that using git reset command, if you need to undo all file Or you may need to undo just one then you can do using git reset command, you can see bellow command.
Example:
// For Spesific filegit reset
// For all files
git reset
Hope this code and post will helped you for implement How to revoke 'git add' before 'git commit' ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs
You need to see bellow example, you can also run bellow html file and see the results. You can also check demo.
Example:
<html>
<head>
<title>How to generate random string in javascript? - ItSolutionStuff.com</title>
</head>
<body>
<input type="button" value="Create Random String" onClick="alert(generateRandomString(10))">
</body>
<script type="text/javascript">
function generateRandomString(length) {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < length; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
</script>
</html>
I hope it can help you…
Hope this code and post will helped you for implement How to generate random string in javascript?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs