get last part of path js code example
Example: get last element path
>>> os.path.basename(os.path.normpath('/folderA/folderB/folderC/folderD/'))
'folderD'
>>> os.path.basename(os.path.normpath('/folderA/folderB/folderC/folderD/'))
'folderD'