07:31String slicing in JavaScript ✂️【3 minutes】
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.





