In a real world this might be implemented as a Babel plugin which optimizes both definitions and calls to a “normal” expression like indexOf('The owls are not what they seem.', 'o', 5). Optional type checks could be added to a runtime.