JSFiddle - React, Tailwind, and code Playground

JavaScript

String.prototype.strstr = function(search) {
    var position = this.indexOf(search);
    if (position == -1) {
        // not found
        return false;
    }
    
    return this.slice(position);
};

var x = 'Hello cruel world';
alert(x.strstr('cruel'));