0

I have a url string, i need to get the last word of without extension.

I need to get the tiger word from this so what i am trying is I am able to get it, is there any simple way to achieve this.

let url = "https://lorem.ipsum/picsum.photos/id/tiger.png"

let word = url.split("/").reverse()[0].split(".")[0]

console.log(word)
dev
  • 814
  • 10
  • 27

0 Answers0