to check if stringA exists in stringB you may uses this condition
if ((stringA).match(stringB))
THe above detects the occurrence in any position: initially, in the middle, finally.
How to narrow the search to the end of stringB only?
I have tried preceding the condition with this:
stringB=(stringB.substring(Math.abs(stringA.length-stringB.length)))
but it does not work. pls help