Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function password(input) {
- let username = input[0];
- let password = input[1];
- let data = input[2];
- let index = 3;
- while(data !== password) {
- data = input[index];
- index++;
- }
- console.log(`Welcome ${username}!`);
- }
- function sequence([arg1]) {
- let n = parseInt(arg1);
- let num = 1;
- while(num <= n) {
- console.log(num);
- num = 2 * num + 1;
- }
- }
- function numberInRange(args) {
- let i = 0;
- let num = parseInt(args[i]);
- while(num < 1 || num > 100) {
- i++;
- console.log(`Invalid number!`);
- num = parseInt(args[i]);
- }
- console.log(`The number is: ${num}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement