Answers for "Remove the last character from String using Slice"

0

Remove the last character from String using Slice

const bookName = 'Atomic Habits' // 13 characters (indexes between 0 and 12)
const newBookName = bookName.slice(0, bookName.length - 1) // Between (0 and 12)

console.log(newBookName)
// Output: "Atomic Habit"
Posted by: Guest on April-25-2022

Code answers related to "Remove the last character from String using Slice"

Browse Popular Code Answers by Language