- [Instructor] We've looked at array and string methods … like startsWith, endsWith, and includes. … Well, I got another one for you, .repeat. … The repeat method builds and returns a new string … which contains a certain number of copies of the string. … Let's take a look. … First, we're going to create a variable, … and our variable will be called yell. … So, another woo yell for our class today. … We're also going to add party. … And party, we'll set equal to yell.repeat, … and we'll pass in the number of times … that we want this to repeat, which is 20. … Now if we console.log party, … we'll see woo, woo, woo, woo, woo, woo, woo 20 times. … So the repeat function, again, … is just going to make a copy of that string. … You could also use the repeat function … inside of an object that has a few methods. … We're going to create an object called cat … that has a meow method inside of it. … Now this function is going to take in … a certain number of times that a meow happens … and then repeat it in the console. …
This course was created by Eve Porcello. We are pleased to offer this training in our library.
- What is ECMAScript?
- Writing and searching strings
- Writing maps
- Destructuring arrays
- Searching arrays
- Creating objects
- Destructuring objects
- Iterating with the for/of loop
- Getting and setting class values
- Using ECMAScript functions
- Building and returning promises
- Using async/await syntax
Skill Level Intermediate
1. What Is ECMAScript?
What is ECMAScript?1m 44s
2. ECMAScript Variables and Data Structures
3. Arrays and Array Methods
Destructuring arrays1m 34s
4. ECMAScript Objects
5. ECMAScript Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.