all of them are very useful examples. Adding String.prototype.endsWith = function(str)
will help us to simply call the method to check if our string ends with it or not, well regexp will also do it.
I found a better solution than mine. Thanks every one.