best way to split string in javscript code example

Example 1: javascript split string

// Split string into an array of strings
const path = "/usr/home/chucknorris"
let result = path.split("/")
console.log(result)
// result
// ["", "usr", "home", "chucknorris"]
let username = result[3]
console.log(username)
// username
// "chucknorris"

Example 2: split text javascript

<p className="text-bold-500 mb-0">{row.BusinessDescription.length > 100 ? `${row.BusinessDescription.slice(0, 100)}...` : row.BusinessDescription}</p>