if $('.item:last').attr('id').split('-')[1] is not undefined var liid equals that, and if it is undefined then it equals null
if $(‘.item:last’).attr(‘id’).split(‘-‘)[1] is not undefined var liid equals that, and if it is undefined
Share
assuming that .item:last is defined:
otherwise: