How to get file name from path in JavaScript

Strings
Last updated Feb 02, 2018
const url = "/Users/code/codetogo/index.html";

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