Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function nums100To200(input) {
- let num = Number(input[0]);
- if (num < 100) {
- console.log('Less than 100');
- } else if (num > 200) {
- console.log('Greater than 200');
- } else {
- console.log('Between 100 and 200');
- }
- }
- РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОР:
- function nums100To200(input) {
- let num = Number(input[0]);
- console.log(num < 100 ? 'Less than 100' : num > 200 ? 'Greater than 200' : 'Between 100 and 200');
- }
Add Comment
Please, Sign In to add comment