Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Password(input) {
- let user = input[0];
- let pass = input[1];
- let index = 2;
- while (input[index++] !== pass){
- }
- console.log(`Welcome ${user}!`);
- }
- Решение с фор цикъл:
- function password(input) {
- let user = input[0];
- let pass = input[1];
- for (let i = 2; i <= Number.MAX_VALUE; i++) {
- if (pass === input[i]) {
- console.log(`Welcome ${user}!`);
- return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement