Created
August 22, 2020 10:34
-
-
Save iamsaief/4a81569ba409101d7dfbed2323976764 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
/* slice(), splice(), join() */ | |
const sports = ["β½οΈ", "π", "π", "π", "πΈ", "π", "π", "π±"]; | |
const part = sports.slice(3, 6); | |
console.log(part); | |
// Output: ["π", "πΈ", "π"] | |
const removed = sports.splice(2, 6, "π", "π€Ή"); | |
console.log(removed); | |
console.log(sports); | |
/* | |
Output: | |
["π", "π", "πΈ", "π", "π", "π±"] | |
["β½οΈ", "π","π", "π€Ή"] | |
*/ | |
const together = sports.join(","); | |
console.log(together); | |
// Output: "β½οΈ,π" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment