var filename = fullPath.replace(/^.*[\\\/]/, '')
This will handle both \ OR / in paths
More Related Contents:
- phone number validation in js [closed]
- Share data between AngularJS controllers
- When is .then(success, fail) considered an antipattern for promises?
- How to show the “Are you sure you want to navigate away from this page?” when changes committed?
- Is it possible to focus on a using JavaScript focus() function?
- Node.js global variables
- Best Practice: Access form elements by HTML id or name attribute?
- JavaScript loop through JSON array?
- Google maps API V3 – multiple markers on exact same spot
- Difference between console.log and return in javascript? [closed]
- SyntaxError: expected expression, got ‘
- How to know if a function is async?
- How to make a radio button unchecked by clicking it?
- Embedding SVG into ReactJS
- Simple ajax form using javascript no jQuery
- How does !!~ (not not tilde/bang bang tilde) alter the result of a ‘contains/included’ Array method call?
- JavaScript function similar to Python range()
- Discord API valid intents must be provided for the client [duplicate]
- Difference between Array.length = 0 and Array =[]?
- Is there a way to get Chai working with asynchronous Mocha tests?
- angular 4+ assign @Input for ngComponentOutlet dynamically created component
- A plain JavaScript way to decode HTML entities, works on both browsers and Node
- Why need useRef and not mutable variable?
- ScrollTo function in AngularJS
- Running Node.js in apache?
- Is there a good use case for the constructor property in Javascript?
- Disable chrome react DevTools for production
- You’re importing a component that needs useState. It only works in a Client Component, but none of its parents are marked with “use client”
- Passing a function with arguments as an argument?
- HTML5: Detecting if you’re on mobile or pc with javascript? [duplicate]