Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Create a function "weatherForecast" with two parameters "city" and "weather".

If second argument is absent, "weather" parameter should get value "Great weather!".

1. First solve this WITHOUT default function parameter.
2. Comment previous solution and solve same task WITH default function parameter.

NOTE: Carefully compare your results with test calls results
*/

console.log(weatherForecast("Dubai", "Sunny"));
// Weather forecast for Dubai: Sunny

console.log(weatherForecast("London", "Light rain"));
// Weather forecast for London: Light rain

console.log(weatherForecast("Paris"));
// Weather forecast for Paris: Great weather!

console.log(weatherForecast("Miami", ""));
// Weather forecast for Miami:

console.log(weatherForecast("Las Vegas", undefined));
// Weather forecast for Las Vegas: Great weather!