How to get file name from path in JavaScript

Strings
By Jad Joubran · 
Last updated Dec 26, 2018
const url = "/Users/code/codetogo/index.html";

url.substring(url.lastIndexOf("/") + 1);
index.html