Created
April 27, 2021 22:16
-
-
Save leightkt/d6fc34b099702dff6d11027036166080 to your computer and use it in GitHub Desktop.
This file contains 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
myCake = [chocolateLayer, whippedCream, vanillaLayer, fruitFilling, strawberryLayer, frosting] | |
wholeSlice = myCake.slice() | |
// gives me ALL the good cakey goodness | |
bottomSlice = myCake.slice(0, 3) | |
// gives me the bottom half [chocolateLayer, whippedCream, vanillaLayer] | |
justTheFrosting = myCake.slice(-1, 1) | |
// give me just the last item - the frosting! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment