Using New(ish) JavaScript String Methods: trim, startsWith, endsWith, includes, and repeat


In the past, you had to create your own functions for simple actions like trim or startsWith, but recently JavaScript has been adding additional methods to the string object to allow you to use trim, startsWith, endsWith, includes, and even repeat. In this video, we look at each method in turn, including how you would accomplish it before JavaScript added them to the string object.

JavaScript is the assembly language of the web, but that hasn’t prevented it from being the punchline of jokes for the last decade or so because of some of its weird quirks, and the various ways in which browsers have implemented it. In this video tutorial series, we’re going to go over modern JavaScript, and why, if you hate JavaScript, you shouldn’t anymore.

If you like this video and want to go deeper, check out or subscribe to our newsletter at

Interested in building chatbots in JavaScript and TypeScript? Check out my book:

To stay in touch, following me on Twitter at

You can also follow Bill:

Don’t forget to subscribe to this channel for updates:

javascript, javascript strings, how to trim a string in javascript, idonthatejavascriptanymore, i dont hate javascript anymore, es6, ecmascript2015, javascript string methods, new javascript string methods

Xem Thêm Bài Viết Về Thủ Thuật Hay Khác:



Please enter your comment!
Please enter your name here