Build a JavaScript random password generator 🔑

  Рет қаралды 20,681

Bro Code

Bro Code

Күн бұрын

Пікірлер: 32
@BroCodez
@BroCodez Жыл бұрын
// RANDOM PASSWORD GENERATOR function generatePassword(length, includeLowercase, includeUppercase, includeNumbers, includeSymbols){ const lowercaseChars = "abcdefghijklmnopqrstuvwxyz"; const uppercaseChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const numberChars = "0123456789"; const symbolChars = "!@#$%^&*()_+-="; let allowedChars = ""; let password = ""; allowedChars += includeLowercase ? lowercaseChars : ""; allowedChars += includeUppercase ? uppercaseChars : ""; allowedChars += includeNumbers ? numberChars : ""; allowedChars += includeSymbols ? symbolChars : ""; if(length
@Knightd-d9m
@Knightd-d9m 11 ай бұрын
Wonderful bro!!! Can you please make a full course on React, Angular, Node..Please
@leestanford2452
@leestanford2452 5 ай бұрын
This is the first lesson that lost me. the string concatenation with the ternery operators portion is not really clicking yet.
@hunin27
@hunin27 11 ай бұрын
Hey just a question, when i was learning python some months ago, i found out that for passwords its better to use secrets.choice instead of random.choice as it is more suited for passwords, is there such a thing in javascript? thanks!
@nguyenphulam2849
@nguyenphulam2849 11 ай бұрын
Can you please make a full course on Angular, NodeJS Broo pls
@pogmij
@pogmij 11 ай бұрын
Appreciate that, thanks man
@emmanueloyenuga2047
@emmanueloyenuga2047 14 күн бұрын
I was looking at this code and I understand the concept for the most part of it but the function generatePassword, you passed the argument length into the function but unlike the other arguments passed, Length was not declared, I was expecting passwordLength would have been passed instead. I would appreciate clarity on that please. Thank you 🙏 When calling the function at the bottom you called passwordLength
@musablodhi6526
@musablodhi6526 Күн бұрын
I see what you're saying! In JavaScript, when you define a function, you can name the arguments however you like. In the example from the video, the function generatePassword uses the argument length, but you could also name it passwordLength if you prefer. The key is to stay consistent in both the function definition and when calling the function. In the video, the parameter is named length, so when calling the function, you should pass the value into length (or passwordLength, if you rename it). Just make sure the names match. Hope that clears it up!
@raitaskeen
@raitaskeen 11 ай бұрын
Bro Code Please make a video on TypeScript Kindly...
@piotrmazgaj
@piotrmazgaj 3 ай бұрын
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
@Blitz61wasd
@Blitz61wasd 11 ай бұрын
Cool
@jerricvaleroso8835
@jerricvaleroso8835 8 ай бұрын
I tried this program in java. More steps than JS.
@toufiktoufik8342
@toufiktoufik8342 11 ай бұрын
Thank you bro
@hlahtunthein2830
@hlahtunthein2830 3 ай бұрын
sir, can we get this tutorial with some html css UIs please?
@drzion247
@drzion247 4 ай бұрын
welldone Brou!!!!!!!
@raphaelsousa2046
@raphaelsousa2046 4 ай бұрын
the loop that creates the password is kinda complex but i guess i got it
@AmitUtkarsh99
@AmitUtkarsh99 2 ай бұрын
but this code doesnt ensure that if a set of character type is true it would be included in the password
@hunin27
@hunin27 Жыл бұрын
thanks bro!
@natnaeltaye
@natnaeltaye 8 ай бұрын
yo bro i set "includeSymbols" to be false and still appears on console.log, why does this happen?
@arnavsail
@arnavsail 10 ай бұрын
how do i display this password in my web page?
@tharunkumar8507
@tharunkumar8507 10 ай бұрын
You can display by using window.write() to display on your web page
@ronitghosh9461
@ronitghosh9461 7 ай бұрын
Password Generator * { box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; font-size: large; } .center { display: flex; justify-content: center; } h2 { font-size: 30px; font-weight: 800; text-align: center; color: #2d4059; } form { box-shadow: 5px 5px 15px; border-radius: 10px; width: 500px; height: 550px; padding: 5px; } .radioButtons { margin: 15px; margin-left: 40px; color: #222831; } input { margin: 5px; } #length { width: 80%; height: 40px; border-radius: 10px; border: none; background-color: #eeeeee; text-align: center; font-size: 25px; color: #222831; } #length:hover { box-shadow: inset 1px 1px 6px rgb(66, 66, 66); border: none; } #length:active { box-shadow: inset 1px 1px 6px rgb(66, 66, 66); border: none; } .characterLength { display: flex; flex-direction: column; align-items: center; font-size: 25px; font-weight: 700; color: #222831; } button { width: 400px; height: 40px; margin: 10px; border: none; border-radius: 10px; font-size: large; background-color: #222831; color: #eeeeee; } button:hover { background-color: #3b4555; } button:active { background-color: #54647c; color: #eeeeee; } .password { width: 400px; height: 60px; margin: 10px; border-radius: 10px; background-color: #eeeeee; color: #222831; display: flex; justify-content: center; align-items: center; overflow: auto; font-size: larger; padding: 2px; } @media (max-width:600px) { form { width: 90vw; overflow: auto; } h2 { margin-left: 10px; margin-right: 10px; } } PASSSWORD GENERATOR Characters Length: Lowercase Characters Uppercase Characters Numerical Characters Symbols Generate Copy function generatePassword() { const length = Number(document.querySelector("#length").value); const lowercase = document.querySelector("#lowercase").checked; const uppercase = document.querySelector("#uppercase").checked; const numeric = document.querySelector("#numeric").checked; const symbols = document.querySelector("#symbol").checked; const printAns = document.querySelector(".password"); const pass = randomPass(length, lowercase, uppercase, numeric, symbols); if (!lowercase && !uppercase && !numeric && !symbols) { printAns.textContent = "Please check at least one option"; return; // Stop execution } printAns.textContent = pass; } //Random Password Funtion function randomPass(length, lowercase, uppercase, numeric, symbols) { const lowercaseChars = "abcdefghijklmnopqrstuvwxyz"; const uppercaseChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const numericalChars = "1234567890"; const symbolChars = "@#$%&*!?>
@RhemaOshogwe
@RhemaOshogwe 5 ай бұрын
Flutter
@DhanaLakshmi-tz6mg
@DhanaLakshmi-tz6mg 8 ай бұрын
Could you please talk slowly ,so that it is easy for us to understand ....
@chiggywiggy524
@chiggywiggy524 7 ай бұрын
Turn on captions
@uchegodswill397
@uchegodswill397 7 ай бұрын
You can reduce the speed by clicking on settings and playback speed
@raitaskeen
@raitaskeen 11 ай бұрын
Typescript...!
Learn JavaScript CALLBACKS in 7 minutes! 🤙
7:17
Bro Code
Рет қаралды 64 М.
JavaScript Password Generator
35:31
Traversy Media
Рет қаралды 132 М.
Happy birthday to you by Secret Vlog
00:12
Secret Vlog
Рет қаралды 6 МЛН
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,3 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Random Password Generator in JavaScript
26:03
Daniel Vega
Рет қаралды 6 М.
JavaScript Visualized - Execution Contexts
11:41
Lydia Hallie
Рет қаралды 69 М.
Build JavaScript ROCK PAPER SCISSORS in 18 minutes! 👊
18:54
JavaScript Global Execution Context Explained!
27:25
Piyush Garg
Рет қаралды 10 М.
Password Generator in HTML, CSS & JavaScript
28:22
Tyler Potts
Рет қаралды 4,5 М.
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 660 М.
Build A Password Generator With JavaScript - Tutorial
27:53
Web Dev Simplified
Рет қаралды 67 М.
🎬Random Password Generator | Html CSS Javascript✨
16:41
Web Dev Made Easy
Рет қаралды 6 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН