// String.prototype.includes(substring, startingAt) 'Hello world'.includes('wor') // true 'Hello world'.includes('hell') // false, sensible à la casse 'Hello world'.includes('Hello', 1) // false, on commence à 1 // String.prototype.startsWith(substring, startingAt) '42, born to code'.startsWith('42') // true '42, born to code'.startsWith('foo') // false '42, born to code'.startsWith(42, 1) // false, on commence à 1 // String.prototype.endsWith(substring, startingAt) '42, born to code'.endsWith('code') // true '42, born to code'.endsWith('born') // false '42, born to code'.endsWith('code', 5) // false, on arrete à 5 // Exemple equivalent es5 String.prototype.startsWith = function(substring, startingAt) { startingAt = (startingAt) ? startingAt : 0; return (this.indexOf(substring) === startingAt); };