JavaScript determines whether a string contains a specified substring

From , 5 Years ago, written in JavaScript, viewed 241 times.
URL https://pastebin.vip/view/dc36f18a
  1. if (!Array.prototype.indexOf) {
  2.     Array.prototype.indexOf = function(obj, start) {
  3.          for (var i = (start || 0), j = this.length; i < j; i++) {
  4.              if (this[i] === obj) { return i; }
  5.          }
  6.          return -1;
  7.     }
  8. }
  9.  // http://www.sharejs.com
  10. if (!String.prototype.contains) {
  11.     String.prototype.contains = function (arg) {
  12.         return !!~this.indexOf(arg);
  13.     };
  14. }
  15.  
  16.  
  17. //javascript/8789

Reply to "JavaScript determines whether a string contains a specified substring"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website