From 7cc5f8f460bdf607e7e21f4d7d5d13cb5e42fba4 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 6 Sep 2018 23:52:51 +0300 Subject: [PATCH 1/3] Final --- index.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/index.js b/index.js index e69de29..f53ff3c 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,21 @@ +/* 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: Great weather! From 2249d4686d928fbcac768eba380d8557da05306f Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 7 Sep 2018 09:07:47 +0300 Subject: [PATCH 2/3] Fix --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index f53ff3c..4405f2a 100644 --- a/index.js +++ b/index.js @@ -19,3 +19,6 @@ console.log(weatherForecast("Paris")); console.log(weatherForecast("Miami", "")); // Weather forecast for Miami: Great weather! + +console.log(weatherForecast("Las Vegas", undefined)); +// Weather forecast for Las Vegas: Great weather! From 23a311b20bd9694e8eb820b21d4d2eb5728b33c4 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Fri, 7 Sep 2018 09:30:22 +0300 Subject: [PATCH 3/3] Fix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 4405f2a..58a98a6 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,7 @@ console.log(weatherForecast("Paris")); // Weather forecast for Paris: Great weather! console.log(weatherForecast("Miami", "")); -// Weather forecast for Miami: Great weather! +// Weather forecast for Miami: console.log(weatherForecast("Las Vegas", undefined)); // Weather forecast for Las Vegas: Great weather!