Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function weatherForecast(input) {
- let weather = input[0];
- if (weather === "sunny") {
- console.log("It's warm outside!");
- } else {
- console.log("It's cold outside!");
- }
- }
- ИЛИ ТАРИКАТСКАТА С ТЕРНАРЕН ОПЕРАТОР:
- function weatherForecast(input) {
- console.log(`It's ${input[0] === "sunny" ? "warm" : "cold"} outside!`);
- }
Add Comment
Please, Sign In to add comment