I trust you are doing well.
Recently, I have embarked on a coding journey and encountered an interesting challenge. The task requires me to create a function that outputs specific weather conditions for different countries to the console:
The weather in Scotland is sunny
The weather in Spain is glorious
The weather in Poland is cold
=> undefined
However, I am facing some confusion as the instructions mandate that I start this function with the keyword 'const' followed by the const name. Despite my efforts, I am uncertain if my solution meets the specified requirements.
function getWeather (country, weatherType) {
console.log('The weather in ' + country + ' is ' + weatherType);
}
getWeather('Scotland', 'sunny');
getWeather('Spain', 'glorious');
getWeather('Poland', 'cold');
The task demands a function with two parameters (country & weatherType), along with providing two arguments (a country's name & its corresponding weather type). Ultimately, the goal is to display these details in the console following the format 'The weather in 'country' is 'type of weather.'
If anyone could offer assistance, it would be greatly appreciated. Thank you so much.