JavaScript Everything Arrays | Laurence Svekis | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

6 Lessons (44m)
    • 1. 1 Arrays Course Intro

    • 2. 2 JavaScript Variables Data Types

    • 3. 4 JavaScript How arrays work

    • 4. 5 JavaScript working with Arrays

    • 5. 6 JavaScript Arrays in Action

    • 6. 7 JavaScript Arrays as Strings and Slices

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

JavaScript Everything Arrays

Arrays are a fundamental building blocks of JavaScript this course will help you better understand how to utilize arrays

Learning how to use arrays within JavaScript will help you better develop JavaScript code. Arrays are one of the fundamental building blocks of JavaScript!

Learn how to store values in arrays and how to work with arrays to utilize data.

Storing Values Working with Arrays

Lets you store multiple values in single variable

creating Arrays
literal array
By the end of the course you will have the skills and know how to apply arrays within you website.

I am here to help you learn how to create your own websites and ready to answer any questions you may have.

JavaScript is the most in demand skills, and learning how to use JavaScript will help to separate you from the crowd.

Want to know more, what are you waiting for take the first step. Join now to start learning how you too can create arrays within your website today.

Meet Your Teacher

Teacher Profile Image

Laurence Svekis

Web technology Instructor


Web Design and Web Development Course Author - Teaching over 700,000 students Globally both in person and online.   

I'm here to help you learn, achieve your dreams, come join me on this amazing adventure today
Google Developers Expert - GSuite

Providing Web development courses and digital marketing strategy courses since 2002.

Innovative technology expert with a wide range of real world experience. Providing Smart digital solutions online for both small and enterprise level businesses.

"I have a passion for anything digital technology related, enjoy programming and the challenge of developing successful digital experiences. As an experienced developer, I created my first computer applications in 1990,... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. 1 Arrays Course Intro: in this course, we're gonna be looking at data types and how to use various data types within JavaScript that JavaScript, the cornerstone of JavaScript are the different data types. And understanding how to use data types is really important. Name is Lawrence, and I've been a Web developer for over 15 years, and I'm going to be sharing my knowledge with you. Within this course, we're going to start the course off by looking at the different data types, the default data types, the main use data types like strings numbers and Boolean values. And then we're going to be looking at different ways of storing values and what to avoid when you're creating variables. And we're also going to look at a raise now a raise, provide some amazing, wonderful functionality that you can really utilize within your JavaScript. So we're going to looking at how toe work with the rays and commonly used functions that are available to really accelerate what you can do with the rays. We're gonna look at ways to join a raise, of course, setting up a raise, pushing values, sorting a raise and a whole lot more. We've designed this course in order to fully cover JavaScript a raise in order for you to help. You better understand and learn to use JavaScript a raise within your coding. We're going to be using our brackets as editor. Also gonna be using chrome as our browser is. Crume really does have really good depth tools. So this comes already pre loaded within every version of chrome. And this is the console. So we're gonna be using an out putting our content within the console. So that is visible. To be able to understand what's happening with our JavaScript. This is just a sample off what we're gonna be looking at when we start working within the source code. So when you're ready, let's start working with the rays and showing doing with a raise in javascript. 2. 2 JavaScript Variables Data Types: in the previous lesson, we introduced you to variables and how useful it was that we could actually contain some set of information and call back on it and use it within our JavaScript. So again, this is one of those fundamental building blocks of javascript and understanding how to create and use variables in an effective manner will really help you accelerate your JavaScript. Learning experience is essentially there are three main types of variables. We've got strings, numbers and Boolean. So you're going over what? The differences are between those. So just opening up our source code, we see that we've been using variables before within our source code. And what we did over here is we set this v A are we had a name for the variable and we had this equal sign. So this is an assignment operator, and essentially, this is setting my name equal to whatever is another side. But just like a mathematical formula, where you have a equals, whatever b equals whatever and having that equal sign makes them equivalent. And this is how we set variables. And we also notice that we had to start it and define the variable before we can use it. So if the variable wasn't defined at any point within our script, then we weren't able to actually have access to it s So that's where we use that v a r and within code pen. They highlighted as blue characters. So we've got via our my name equals and then we just left it blank. So any content between those double quotes would be that default variable. So if I put something like default or something like that in there and if I go back out to my source code and if I again, we always got to remember that we do need to refresh it. So if I click this, we see that we get whatever value has been assigned to that variable. Whenever we click and remember again over here, when we click button three, we get that output that console log output, because we want to make sure that we are contents of my name actually contain not value. Now there's some a few things to remember when you are daming your variables that for best practices they should begin with the letter. You can also begin them with an understand with an underscore that should have been over here. You could also start them with the dollar sign. So this is commonly used when you using J Query, you're going to see the dollar signs quite used quite often. And there's a few characters that you can't start them with. So, of course you can't start them with any numbers. Eso we see that immediately. It goes green because not being interpreted as the variable Although we can place numbers anywhere after that firms character. So the most important part is whatever that first character is, And those air the three different ways that you can begin your first character of your variable. And then after that, of course, you can use numbers as well within your variable name. And generally we see that we're writing variables as Camel case. So all that means is that we start with a lower case for the first word and then an upper case for subsequent words. So we have this one s o there are naming conventions as well. So typically you want to make them. You want to name your variables something that really just makes sense. And because this was actually containing the name information from the prompt. This is why we called it my name. And we see that the upper. So we started with a lower case because essentially, this is two words. So my and then the upper case name because that's the second word. So we don't include spacing because that again, that will throw off the JavaScript s. So that's a no no with in your JavaScript And we can really be something simple. Like, we could just start with an A or something like that. So we could just as easily creative variable with a or any combination of words, letters, numbers. As long as we don't start the number, start with a number. So essentially, the name off the variable can be anything you want, as long as it really just, uh, common practice. Good practice is toe Have it contained. Meaning s so that when you do have a whole bunch of variables, you maybe just have a whole bunch of A's. B's sees a whole bunch of letters that don't really make a lot of sense. So you do want to make sure that does contain some some meaning into it You can also do the variables with single quotes or double quotes. So I could just as easily just, uh, single quote this as well. And it will work the same way. See that the those were just being added in brackets. We have also the option of if we've got a single quote. But we also want to have, like, maybe apostrophe s or something like that. We see that what happens is it actually breaks out of the quote, so we don't want that to happen. Eso weaken back slash that just like we did with the new line break where we do this box slash and that gives us the ability to include a quote within a quoted object because usually as soon as you place that quote, it breaks that value up into two separate values. So this is an example off a string variable. Also, if we want to set a number of variables, I'm going to just set this as number and maybe just pick any number off the top of my head . So for one of my favorite numbers, and so this is how we set a number variable, and we also have what's called a boo lean, and the way that Julian's work essentially think of them as a switch so they can be turned on or off so they can be false or they can be true, so they only contain two values you can't preset like numbers or anything in them. So it's either either true or false. And the value of billions is that a lot of times within JavaScript, especially when we're checking for conditions to see if conditions are being met, then we just simply have to see if it's true or false, and that acts as a switch within the condition. And it allows us Teoh continue and apply pieces of logic and terror. JavaScript. So they're very functional, although maybe initially, that you might be wondering, Well, what's the point of the Boolean? Because I can't really define what it's going to contain, but they are very functional and they're commonly used within JavaScript. Also, when you're doing declarations, we can declare multiple variables. So if I wanted to declare a I want to declare so maybe a as equal to a a lot to clear be is equal to be, of course, and so on. All we have to do is comma separated, and we can have multiple values and comma separated. And this actually automatically will allow us to declare a B C without having to write via our multiple tires. Let's just go back into our source code. Refresh it and maybe we can console log out some of those values that we've created. So I'm gonna console, log out A We see that a has a value of a Of course, there's also, and this undefined is just that returned value. So this is this something that the consul is including. So not to worry, that you're probably wondering what What does that mean? Eso that's nothingto worry about right now because we're not actually defining and returning anything value within their We're just asking for the consul toe output, the value of a and this is just what the consul is returning because we're not defining anything beyond the A. Of course, there was also the my Boolean, and we can see that we've got a value of true for them. My Boolean. That's how you set variables and these are the fundamental core building blocks of javascript, so get to know one get to understand variables. Well, because you're going to be using them. No matter what javascript you're writing, you're gonna be using variables and they're not very complicated. And it's really easily and flexible what you can do and how you can set up variables. So the next lesson we're gonna look at working with variables, different types of variables, introducing you to a raise and allowing us to store multiple values within one variables. So we're going to expand on these three basic variables and show you some additional types of storage units within JavaScript, so it's coming up in the next lesson. 3. 4 JavaScript How arrays work: the previous lesson. We looked at storing values as variables. So we looked at different ways of naming conventions and how some of the more common types of values that we can store in variables. And there are additionally some other ways to store values within your JavaScript. And one of them is gonna be a raise, and other ones going to be objects now raise give you a bunch of functionality that comes pre built within the arrays, which we're gonna be looking at in the upcoming lesson as well. And it allows you essentially to store multiple values within one variable. And there's a big advantage to using a raise and working with the raves because of the ways that you can handle all of those values that are contained within that one array. So let's take a look. Let's open up our editor and start creating some arrays can open up the editor, and these were initially the variables that we have looked at in the previous lesson. So in this lesson, we're gonna simply look at creating some arrays. So I had us remove out this stuff that we have here before because we don't really necessarily need any of this information. Maybe I'll just clicthat click one button in case we do need to add some functionality and treat our first story. So the same way that we set up a variable V a r. We can set an array. So this is gonna be maybe something we call it my array and the same thing where we're defining it equal to what we use. Brackets. We've got thes square brackets that we're gonna be using for a raise. And this type of ary is what's called implicit literal array. There's a few different ways of different types of a raise and show you essentially the three different types. Eso Essentially, they're all the same that they function within the same way you can do the same functionality within them. But there's just different ways of defining your raise. So this would be one way we're doing variable, my ary, and we've got an idea of our ray values right off the bat. Maybe if we want to have a variable, I called one. So this would be my array would contain this value of one. And whenever we want output, the array of value So I got a console log, goat and just like what we did before we do my array. But we need to identify which item we want output from the arrange. So if I do my ary zero because a raise start at item zero, I should get the value that's contained within one. Let's go back out and refresh it and we see that we do get that first value being output eso again remember that a raise start at zero. So this first item is a zero or item zero and it's equal to the value of one. And the beauty of it raises that we can contain multiple values so I can have another value of two. And this works the same way as what we looked at, How we can set the different types of variables. So we set up initially, we set up strings string values, we set up numeric values, and we can do the same thing in a race, and the format is gonna be the same. And the idea is gonna be the same. So string types are gonna have quote surrounded numbers, don't need quotes, so you can just simply state the number and even if we want to do Boolean, we can do a Boolean value as well. Eso maybe I can do something like this for something. Eso my question to you is how do we output this second item here? So how do we output to show you how we can output the value for one? So what do you think? We need to rate within console log my array in order output to within the console so lets you think about that for a second. And remember again that arrays start at 00123 So too is actually going to be the second item within their ray. But it's gonna be positioned one. So by default, we started zero. So at position one, we have a value of two. And when we refresh, we go and we see that it is getting output within the console. It is very easy, straightforward and logical how this gets output. So opening up our source code, I did mention that there are other ways to declare a raise. So let's see, you had on erase. I'm gonna do variable and I'm gonna call it my array and that maybe I would give it my Arabi. So this one, I'll change to my array. A. And I got an update that there were gonna throw an error. So this one's gonna be my array be. And I'm setting up as a new array here. And, um, I'm gonna need to declare that this is gonna be an array. And within here s so this is a global object. It's a constructor for a race. Eso Essentially it's like setting up like a list of objects that are all contained together . But you might not have the definition of them eso if I want to set up an array and I just I don't know how much what I want to do with that array I want maybe set up a blank array. I can do it within this type of format. Eso this will work, but preferably we're doing it with my are a as in this type of literal array s So this is the preferred way of setting up a raise if you've got values. But of course we can set up that there ray within that same type of format. So if I use to just copy the suit. And if I do my rape be and we refresh it, we see that we get that same output. So where we are able to do that same type of format within the runtime Marie's, although it's not preferable that you do it within this way, eso there's also usually runtime is if you just want to set up in a rape, maybe this won't set up a blank array. You're not really sure what you want to do with it where you want to give it five slots right off the bat. Um, and I just gotta put console log, see? So it's going to give us essentially five slots from that ary, and I just put that my reality. But this one and I put that one so we're all the same here. Go back it and refresh it, and we see that we do have the first to look identical. And then the last one is just simply, maybe a placeholder or blank array. So there's nothing in it right now. So if I was to call to the second item in the list, I wouldn't be able to return back anything cause it's not defined. We don't have a second item in that list. And essentially, that's what it would be used for more to define. If I've got some positioning in their re, and because I did define it as a value of five, so it's essentially this is an empty array with five pre defined slots already in it, and we'll see that once we start adding in additional items in the array, which you're going to show you in the next lesson, we're going to see the actual difference between all of these ways of creating a raise, so it's coming up in the next lesson. 4. 5 JavaScript working with Arrays: in this lesson. We're gonna look at working with a raise and a raise. Have these pre built functions were methods and we're gonna talk about functions and methods as we progress through the course. But they've got these pre built functionality units like join, push and sort that allow us to have some out of the box functionality with a raise and one of them, the first memorial look at is going to be how to add items into our raise. The last lesson we showed you how you can set up different types of Aries. So now we're gonna look at how we can add an item to that array. So first, to re that, I'm gonna add Item two. And, of course, with the res, the real reason we're using a raise is because we can contain multiple values. So we've got this, my array a And if I want to add an item at the end of the ary, let's say I wanted toe add five or something like that. What we do is we push the value and this just simply places at the end of their rate. So now when I go and if I open up and write out my array A good to see within our console. We have additional value there. And now, of course, we can call to that value and pull that value out because this is going to be 0123 and four . So all we'd have to do is indicate toe output, the my array A four. And we could get that value for their. So I did say that there is a difference between when we're declaring these arrays. So I got us at an and I'm gonna push this value into my A racy and just to quickly let you know that there will be no difference if I do it my Raby if I push an item. But the difference is here when I push an item to my racy because remember again, we've already declared that five is the number of reserved spots. So when we push an item to the end of a re see, then we're actually going to place it in slot number six, which is gonna be ah value of five if we want to retrieve it. Just show you how this works out. So we see that it's got this. Thats five the coal and five because this is going to be the index value in order to retrieve this value of five because we've essentially started the rate out at five. So there's five blank reserved spots, and when we add something to the end of that, then it's simply placing it within the last slot. And now we're just out putting that array. And even though they're blank, we don't see them within the console log. They're still there. So let's take a look at and see what we can do further with the Rays. So I'm gonna open up the editor again, and I'm gonna consul log with a bunch of information because this is probably the most efficient way that we can actually see what's happening behind the scenes here within JavaScript. So 1st 1 that I want output is my array A. And we already have a pre built way to find out how many items are within their. So we already confined at the length simply by typing in length. And I'm gonna do my array see and find out the length of my racy. So let's take a look and see how this plays out within our console. So we see that this one has five items, which it does, and this one has six. Because again, remember that we reserved those five empty spots. We can also do some comparisons of the different types of a raise so we can see that within console so we can check to see if the different types of arrays are the same by typing in type off and my array A. And we can see if it's actually equal to type off my racy. So let's see if they actually turn out to be the same type of array notes, gloat and refresh it, and we get a boolean value being returned of truth. So that just simply means that the res essentially are the same. The JavaScript sees them as the same type of a raise, even though that we had declared them differently, and by definition one was implicit and one literal array and one was a runtime, a rate we still see them, and we can still work with them within that same fashion. But knowing that we don't need to really continue with having all these comparisons between this different types of a raise, and we're going to just move to working off of that first Meyer A for the next section of the lessons where we look deeper into all the different, really cool things that we can do with JavaScript. Aries. So I'm gonna look in that dot in the upcoming lessons in more detail. 5. 6 JavaScript Arrays in Action: the previous lessons we've looked at how powerful arrays are in JavaScript. So this lesson we're gonna dive deeper into what can be done with the Rays. So let's open up our editor and take a look through. So we initially created an array called My Array A. And in this lesson, we're gonna dive deeper into what we can do with a raise. So we showed you how we can push on item and we can push it to the end of the great. So what happens if you actually want to remove an item from Honore? So I'm going to remove the last item. And the way that we do that is we use pop so simply the function pop and what this is going to do is it's going to remove that last item from the array. And I'm just looking at where I've got that consul log of that my array. Remember again before we come and we hit Pop, we've got an array that contains six items, six values, the last one being six. Now we're gonna do pop, and we're going to remove that last one. So let's refresh it, and we see that we're removing index item number five, which is the last one. So now we've got a brand new array with that ICT last item removed. Well, let's see, You don't want to remove the last one, but you want to remove the 1st 1 So there is a function for this as well within a raise. So we're gonna do my array A and said a pop this time we're gonna do shift. And what this does is this essentially drops the first item and shifts the other ones over , so they're not gonna be thes static values. And this is one of the benefits of doing things dynamically. Eyes, because you're Ray is ever changing s a lot of times when you're developing a javascript, your variables and your values are changing, and this is no different than when you're working with the Rays. So this is why we try to avoid having this static value of four when we're calling an item in the array. Unless that so calls for within the script, and we make it dynamically for when maybe we want to always see what the end item is. So let's open up. Our editor and we'll see what the shift does and what the shift does is it dropped the value of one. Essentially, it dropped that 1st 1 out of the front of the array. So let's see now, we don't like this value of five, and we want to update that. We want to make sure that instead of five, because this is gonna be 0123 So let's say that we want five to say three. So we're gonna look at again calling via the index number. So my array A and remember how we called the value eso We did it by index value. Three. We can also re assign a brand you value to it. And I'm going to reassign capitals three there, and we'll list out that ary again in the consoles. We've got really making good use of console log within this lesson. So when we refresh it now, we've changed 5 to 3, and it's just that easy to work with the Rays. So also, let's take a look at what happens when we want to see the index number, so maybe we've got a value of three, but we don't remember exactly where it's positioned within our array. And this is gonna make a lot more sense once we look at sorting. Because, of course, now we know where we've positioned three eso. Let's open that up again and we're gonna pick up the index value of three. So maybe instead of updating, I'm just gonna do it right within the console. So we're not gonna actually update anything in the worry. We're just gonna output of value. So this time we're gonna use the my array, and we're going to use a method called index of Essentially. This returns the index value off the given element that we're looking for within the array . And if it's not within the ray, we're going to get a value of negative one. Actually, this is a quick weight that we can actually find if ah, value is contained within the array. So let's look for the value of three and see if something that's returned so refreshing again and we see that it gets, we see that's the third item there. And let's say if we did something like X three and now, we should get a value of negative one because it's actually not sitting in their array. That's gone through 0123 and it says OK, well, it's not in here, so it's negative one because it's sitting outside of theory. It's not within the battery than that tries to return that position. So we also have the ability to splice out multiple items out of very so if we want to remove maybe the last two items or something like that. We can do that as well within the rate. So let's do a splice. So another method. And as you can see, there's a whole bunch of stuff that you can literally do with the rays on. This is why we say that working with the Rays and holding these values within their EEZ is really beneficial when you're trying to work with JavaScript because it gives you all of this added functionality that makes it really easily toe add new contents to change contents of their array, move things around and so on. So this time we're gonna look at the array and we're gonna take out the last item from the ray s. So we need to specify are starting position. So let's start it at position number two will remove out only one item. And of course, we could remove out multiple items if we wanted to. So again, Consul, log this out and what I'm gonna do here is I'm gonna comment out a bunch of this stuff because it's really not relevant to what we're doing right now within the code. So see how that turns out so that we don't have a whole bunch of this console log stuff coming showing up. So now we see that we took index value to which was 55 we removed that out. And now we're just out putting it, and we could remove more items as well. Eso We can also unsure ift as well. So if we want to remove out a specific item out of there, if we want to remove out three, we can do my array. And I know my reace stern to shrink down eso we might have to look at updating Syrian, adding to that area as well. So I'm gonna show you how to do that. So there's unsure ift and we're gonna gunship that value of three, see if we can get that removed it from the rate as well. So let's try this and see what this looks like. So there was an error with the way I defined the my area because they didn't put the my Serie A. So, of course, on this is another really benefit to using your Dev tools that I got the air. I mean, that errors are never good, but this was a good demonstration about how errors work in JavaScript. Let me see that Mireille is not defined. So we know that that's the problem, that we haven't defined my array. And that's because I really haven't to find my Rica's the value. We're working with his my array, a eso we see that unsure ift. What that does is that adds in the value of three in the beginning, there a swell, and let's school back into here and talk more about index of. So I'm gonna get rid of some of this stuff here and we're gonna look at index of so one of the things was that we had looked at Well, you know, we've got this index of and I'm gonna get rid of displacing as well, because again, this is getting a lot more complex here. So, uh, we've got index of three there. And so we're getting that value that for three take a look at what else we can do with a raise and another really cool thing that we can do with the Rays. And I should also say, very useful is sorted. Essentially, this sorts on a rate in place and re reorders the array. So now when we console, log out the array and I do want to add in some additional numbers and the reason being is the way that it sorts, it s so we've got some values, there s so we've got more stuff there to sort. So the way it's gonna sort it's gonna sort of numerically first. And then it's gonna sort it alphabetically. Let's take a look and see what happens, and we see once we sort it. But it's taking a brand new order. And another thing to note here is that so we did it numerically and then we did it through through characters. But we noticed that it took that uppercase first. So it goes numbers upper case and then lower case. When it does the sorting eso this is by default, built into built into that method. And now if I do an index of three, we're going to see that that index has changed. And this is another one of those things that if I was actually updating it dynamically, eso if we did something or maybe we can do something like that. So these air no longer going to be the same and we're taking the value of the last one, it's gonna change as opposed to the value that's gonna be contained within their. And I know we don't just have four, and there we have it's six different items in their suite. Have to list this out as five in order to get that last value. But essentially no matter what, we're returning that value of four eso, even though after we do the sorting there were returning that value of fourth that's being returned back, he's and why it's four is because we actually did are sort, so I didn't actually output the sort there. So let's try to do this this way and demonstrate the benefits of being dynamic is that we have the ability to update and always get that last one that's being showing here. Eso Besides sorting, we can also sort in the reverse order. So we've got our my array always called Identify the one that you wanna work with the variable you want to work with And we have reverse so essentially does the opposite of sort . So it's just gonna essentially sort that array in reverse order. And maybe for this one will just put that ary and show you that in fact, it is now reverse order. So starting with the lower case upper case and then America and we can also have the ability to join a raise together. So we're gonna be looking at that and then additional stuff that we do with a raise and more functionalities. Let's coming up in the next set of lessons. 6. 7 JavaScript Arrays as Strings and Slices: So as you can see, there's a lot of stuff we can do with the race. So we're gonna dive that back into a raise, and this time we're gonna add into our race. So maybe we've got one ary here, and I'm gonna call this one my Aree Di, and I'm not gonna change around this stuff too much, but maybe just a few values there so we can see that there are some different values within my radi. So if you've got multiple arrays, it's actually gonna be really easy to add in and update arrays. So we've got on option for that, and the way that we can do that is we can simply can captain eat that ary so I can set and completely entirely separate my ary e And I could contain values of my A rate A and I can can cut it with my array. De so just making sure that I got all of those a re identifiers proper. There s O Now whenever we console log with that, my array e just show you how this is gonna look. So console log and I'm gonna output my r e e and maybe show you the length of my array as well. So lower at it. And I gotta hide some of this stuff here so it doesn't confuse the purposes of this lesson . So let's take a look at what happens now. So remember, we're joining the two arrays together, and we see that we started with my array A and we've joined my a radi into it, and we've combined them together into my every e happens if you want to output your array maybe as a usable string, so you don't want to necessarily have all these items, But you want to be able to see them, maybe visually present them to the user. So there's a number of different options that you can do on one of them is Of course we can . I'm gonna just console log out this one. And of course, we could always set a variable to contain this string value. Simply take, I'm gonna take the shorter one, take my A and I'm gonna use to strength. And what this is going to do is this guy's gonna change the my way into a string were just again We're consul logging all of this out instead of having all these values is separate, we haven't comments separated as a string value, we can also join together so similar to creating it as a string. And of course, this one again we could do the same thing as the string and we can contain variable if we wanted to. So this is again one of those things that's optional Eso we have another option here. We can do join eso We joined all the re elements into a string but maybe we don't want to call my separate them We want to create some other type of separator Eso then this is where we specify the separator. So I'm gonna put this smiley face happy face couple spaces in between there as the separator And now we'll show you how this one turns out within the console Eso we see this string but we've gotten rid of the commas And so that default commas we've updated their own separator within the string is a lot of really neat things you can do We can also if we want to only return part of the string We can do that as well Eso we can do that with Slice . And of course, we always have that option to place it in as a variable and then work with it within her JavaScript. But I'm just trying to demonstrate all these different pieces of functionality that you have with injuries. Eso if I've got my array and this time I'm gonna use that can caffeinated once we've got a lot of content in there, and if I want to return back maybe only part of the rain. So do something like that and we'll show you what happens there. And maybe I should console. Look at that a race so that we have that right above it within the consul and let's see what this turns out. So there's a problem there that Mireille he is not a function so another error. But good thing, because we can see what's happened here with the error with the issue. And of course, I didn't include the slice. So that's why it's actually looking for a function. Eso array e. On its own is not a function, but I needed to include the function of slice. Let's try that again, and with the errors we see, actually, the line of code that created that air. So if I want to take a look at that, I could see the line of code here within the Dev Consul as well. So maybe shrink some of this stuff down. I've got it really enlarged here. So this is why it's harder to see. But let's just go back to the consul and refresh it. And we see that this time we're not getting the air and we see that we're only returning a part of the rain. So we're turning starting out index one and stopping at index three. So this would This is why we're returning these two items here and just going back to our code so we can adjust this. So later on, we're gonna also look at how we can make this dynamics of we had thes increasing or different values being represented here dynamically. This would also return back different pieces of their A and this is how we begin toe work with JavaScript in making a dynamic within the court. And as you can see, there's a lot of different things that we've covered off here on a raise, so it's definitely worth taking a look through the source code, trying it out for yourself. Seeing what you can do with your raise. Create several different arrays. Engine. Just practice updating, adding items, pulling out items and see what you can do with your arrays and try to make it as dynamic as possible using JavaScript and not as much putting static values like we did over here. But try to create some dynamic values so that your array becomes more flexible and adjusts with your coat. So I do advice to check that out to practice and get familiar with all the wonderful things you could do with the Rays.