tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code08:02

Learn JavaScript STRING SLICING in 8 minutes! ✂️

Bro Code ↗

From the creator

// string slicing = creating a substring // from a portion of another string // string.slice(start, end) // ------------ EXAMPLE 1 ------------ const fullName = "Bro Code"; let firstName = fullName.slice(0, 3); let lastName = fullName.slice(4, 8); console.log(firstName); console.log(lastName); // ------------ EXAMPLE 2 ------------ const email = "[email protected]"; let username = email.slice(0, email.indexOf("@")); let extension = email.slice(email.indexOf("@") + 1); console.log(username); console.log(extension);

Published 2023-10-28 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code