May 2018
Intermediate to advanced
190 pages
2h 19m
English
In my previous chapter on ES6 array methods, I introduced the new methods available in ECMAScript 6 that work with the Array type. In this tutorial, you'll learn about new ES6 methods that work with strings: String.prototype.*
We'll develop several examples, and mention the polyfills available for them. Remember that if you want to polyfill them all using a single library, you can employ es6-shim by Paul Miller.
One of the most-used functions in every modern programming language is the one to verify if a string starts with a given substring. Before ES6, JavaScript had no such function, meaning you had to write it yourself. The following code shows ...
Read now
Unlock full access