Skip to content

Instantly share code, notes, and snippets.

@dotNetkow
Created February 1, 2019 17:57
New ES6 string functions result in cleaner code
// New ES6 string functions result in cleaner code
// ES 6
"hello".startsWith("ello", 1) // true
"hello".includes("ell") // true
// ES 5
"hello".indexOf("ello") === 1; // true
"hello".indexOf("ell") !== -1; // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment