Javascript String endWith(char)

Description

Javascript String endWith(char)


String.prototype.endWith = function(char) {
  let string = String(this);
  return (new RegExp(".*" + char + "$").test(string));
}



PreviousNext

Related