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

Learn to Code03:55

String slicing in JavaScript ✂️【3 minutes】

Bro Code ↗

From the creator

#Javascript #string #slice // slice() extracts a section of a string // and returns it as a new string, // without modifying the original string let fullName = "Snoop Dogg"; let firstName; let lastName; //firstName = fullName.slice(0, 3); //lastName = fullName.slice(4); firstName = fullName.slice(0, fullName.indexOf(" ")); lastName = fullName.slice(fullName.indexOf(" ") + 1); console.log(firstName); console.log(lastName);

Published 2022-04-22 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code