#Write our own indexOf utility method
String.prototype.indexOf = function(pattern) {
for (var i = 0; i < this.length; i++) {
var potentialMatch = this.substring(i, pattern.length + i);
if (potentialMatch === pattern) {
return i;
}
}
return -1;
}
console.log("happy happy days at everlane".indexOf("appy days")); //--> 7