Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function password(input) {
- if (input[0] === 's3cr3t!P@ssw0rd') {
- console.log('Welcome');
- } else {
- console.log('Wrong password!');
- }
- }
- Решение с тернарен оператор:
- function password(input) {
- console.log(input[0] === 's3cr3t!P@ssw0rd' ? 'Welcome' : 'Wrong password!');
- }
Add Comment
Please, Sign In to add comment