In the Basic Algorithm Scripting: Confirm the Ending exercise, the slice() method is used to solve the problem. Here’s where I get lost with this challenge. I would never think to use the slice() method in this way because both in the FCC lesson and Mozzila web docs list parameters as the only option.
How do you know when to code something else verses following the syntax rules?
Basic Data Structures: Copy Array Items Using slice()
let weatherConditions = [‘rain’, ‘snow’, ‘sleet’, ‘hail’, ‘clear’];
let todaysWeather = weatherConditions.slice(1, 3);