[Vuejs]-Concat object array with the same name

0👍

My suggestion is simpler and doesn’t require the additional overhead of regex:

const key = '/home/folder/something/mutations.js'
const filename = key.substring(key.lastIndexOf('/') + 1, key.lastIndexOf('.'))
console.log(filename)

Leave a comment