Last active
July 31, 2020 14:07
-
-
Save seandaniel/17dbd91d593032ebafd1895e18f82565 to your computer and use it in GitHub Desktop.
How to use the slice() method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const randomTorontoInfo = ['CN Tower', 'Partly Cloudy', '20°C', 'Blue Jays', 'Doug Ford', 'The Six']; | |
const weatherToronto = randomTorontoInfo.slice(1, 3); | |
console.log(weatherToronto) | |
// ['Partly Cloudy', '20°C'] | |
console.log(randomTorontoInfo); | |
// ['CN Tower', 'Partly Cloudy', '20°C', 'Blue Jays', 'Doug Ford', 'The Six']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment