Class 23: JavaScript APIs for Beginners #

Introduction

Let's go! Best leak ever! It's gonna be live! All right, best leak ever, let's go! Hey! Let's go! All right, all right, all right, all right, all right, best week ever. Good morning. Good afternoon. Good evening. No matter where you're coming from. I hope you are doing well. Welcome everybody. Best week ever. Just getting started.

Today's day one day one a week is seven days long. Today's day one best week ever Thank you for being here, thank you for coming hope you all are doing well We got a lot of fun stuff tonight folks a lot of fun stuff. We're gonna make this the best week ever we're celebrating a hundred plus jobs We came together as a community with the one goal and that goal was to get 100 plus jobs. We got it. We blew past it. You've been in that celebrations channels been popping off. We're well past 100. This is the celebration week for that. And boy, do we got a lot of exciting stuff? We got some stuff today. We got some stuff tomorrow. We got some stuff Thursday. we got some stuff Friday, we got some stuff Saturday, we got some stuff Sunday, we got some stuff Monday, and then we come back on Tuesday for the last day of The Best Week Ever. So let's go. Tonight we're gonna do what we always do, questions, we're gonna talk about The Best Week Ever, all the stuff we got planned for this week, and then we're gonna get our review on.

We're gonna get through functions, we're gonna get through arrays, We're gonna get through objects and if we have some time we'll start with our api So lots of fun stuff to get into but you know, like how we like to do We got questions I got answers question of the day Is are you going rock? paper or scissors or Not risking any of your channel points rock paper scissors are not risking any channel points Indifferent, yo, how's it going? How's it going? So much stuff to happen there. We like had a huge high train before we even started. Melody. Thank you for the raid indifferent a thank you for the 10 gift itself as I appreciate you. Thank you so much. I see some folks a lot of paper a lot of rock no risk. I'm not risking. I'm so close. I'm so close not risking it too precious. I love to see it. Well, we're going to get some YOLOs folks. We can't have day one of the best week ever without some YOLOs.

So there'll be some YOLOs later. If you really, if you're feeling lucky when I put those channel points on the line, I got you. I got you. I always like to give folks a few seconds to get in here. So if you got questions, I got answers. Oh, when is the code newbie podcast coming out? Uh, it's coming out in May. So yesterday, uh, it was really awesome. I got to hang out with the code newbie folks and, uh, we're going to be on the code newbies podcast in May. It was my first podcast. It's, it's a little bit different than being on Twitch. I did like turn and Levi made me feel really comfortable, but it's a different ball game. I got I got to get some PR training or something I got a I got to get my my facts dialed in I felt like I rambled too much, but I think I think we got we got our point across I think we got in there. So I'm really looking forward to it And hopefully that'll be out in May with their next season. Yeah code newbies podcast is awesome.

If you're looking for like a If you're looking for like a really welcoming newcomer podcast then that's it so my maybe my best week ever started yesterday but y'all starts today are you drinking whiskey now it's just some water with some berry mix in it all right folks completed my first code wars all by myself a felt pumped that's awesome sometimes. Good to hear it. First Trey with the podcast. Exactly. Static. You be fancy with the water. I just buy frozen berries and I put it in my water. I don't know if that makes me fancy or not, but I quite enjoy it. Alrighty folks, let's jump into getting this show on the road, best week ever, day one of many, many, many to come. So I want to start off tonight's class with something that I think is very important to bring up and that is to check in. If you haven't checked in yet, go ahead and give this a like and a retweet. Uh, remember that when you, when you type check in here in chat, that doesn't do anything. You have to go to Twitter and do the, the liking and the retweeting. There are some folks that think just typing in like bang check and doesn't know that just brings up the link. So it's good to be clear.

So that way you're, you're doing the liking and the retweeting so that when we get the end and you need help, you've checked in, uh, just want to Make sure everybody's on the same page. I didn't realize that some people thought that that's, that's how it worked, but you actually got to go to Twitter and do it. All right. I see a lot of people that are like, Oh, God's got some classes to go back through. Oh no. You got, got exactly. Oh boy. Great. Thank you for checking in, but seriously, there's something that I want to bring up. My promise when we started this bootcamp is that I go at the pace of the cohort. And my promise with this bootcamp is that as things get tough, I will do my best to pull you back into the roller coaster. What you gotta realize is that we were all on the same ride. Some of us might be in a few seats above, so A few of us might be a few seats back, but we're all on the same roller coaster ride together. And we're gonna go together. Nobody's getting left behind.

We go together, we don't go at all. Now, if things recently have been bumpy for you, the roller coaster feels like it's shaking a little too much, that's okay. you are absolutely 100% not alone. If a race threw you through a loop and your loops gave you properties and methods and the whole thing's getting jumbled, that's all right. You're probably at the back of the roller coaster, still coming down the big dip. You're still being Beyonce, but you're screaming a little too loud. I got you, don't worry. Don't worry. I don't know if anyone's told you yet but this learning the code stuff is pretty hard there there's a reason why not everyone is a developer and it has nothing to do with aptitude it has nothing to do with their ability to be good at math it has to do with everything to do with not giving up finding good ways to manage their frustration, being consistent and taking care of themselves. So, tonight I know a lot of you are in a rough place with the current material and that's okay. What we're gonna do tonight is we're gonna dial down some things and turn some other things up. So we're gonna give you a little bit of breathing room in some areas and dial up some things in other areas. And so if you feel like you're a little behind you feel like things are going a little too fast. I got you We're gonna we're gonna dial some things down refocus in some other areas so we can get through it together now If you're one of the folks that are saying Leon, I'm in the front of the roller coaster, this is great, right I'm my hands are still up. I'm having my best life.

That's great We're gonna go together or or not at all. So if you're not committed to getting to the promised land together, if you're not committed in pulling the folks that are a little bit further behind you on this roller coaster ride along with you, this is not the community for you. Full stop. And so what I need is if you feel that you're in the front, start doing the things that the students that I've had, that have gotten the best opportunities have done. If I look at my students that have gotten the best roles, the students that have gone straight to Fang, they've always had one very important factor that none of my other students had. What they did is they helped others around them. Because here's a funny thing. When you help others that are around you, you solidify concepts. Things that were just on the grasp of your knowledge, right? Things that were just in the grasp of your knowledge become things that are solidified in your brain. When you go into a technical interview, you're not just answering questions, you're talking from experience. It's not only your bugs that you've helped solve, but the bugs of all the other folks that you helped along the way. So when you go into those interviews, it's not just you it's all the folks that help that are there with you So if you're in the front of the car It's time to turn around and pull some folks forward if you're in the back of the car It's time to look forward and see those hands that are reaching out for you ask questions Jump in those discord voice channels ask for help Because we're going together Or not at all So, I wanted to bring up that very, very important fact. You're not alone. If arrays were hard, you're not alone.

If code wars is hard, you're not alone. If objects are hard, you're not alone. If the networking is hard, you're not alone. If getting the client was hard, you're not alone. If any part of this process has been causing you strife and stress, you're not alone. them. You have hundreds of folks that are going through a very similar experience, whether they're vocal about it or not, I guarantee you it's happening. And so what we're going to do is we're going to go through this trough of sorrow together. You're in it. I don't know if anybody told you yet, but you're in it. You're in the trough of sorrow pretty firmly in the trough of sorrow. We're getting real mucky. It's going to get harder. It will. It'll get harder.

But what we're going to do is we're going to focus on learning. I want to be able to turn up the content that we're doing in class, the learning that we're doing. We got to get through objects and then we're getting right into back end. It's going to be a few more classes and then we're doing back end web development. So if you feel like things have been flowing for you, great. Guess what? In a couple of weeks, like two weeks, we're in back end. Yeah, so here's one thing that I've also always noticed. Some folks, the HTML and CSS clicks and it comes easy. For some folks, that never happens. For some folks, the JavaScript clips and comes easy. And for some folks, they struggle with it for a little bit while longer. And then for some folks, they get to the backend and that's their favorite part of the actual learning to code journey. The HTML and CSS didn't make sense. The JavaScript didn't make sense, but the back end just clicks.

So give yourself the chance to be surprised by the back end. You can't throw in the town now. Nobody's getting off this ride, right? We, we, we got some other loop the loops to do, and they're going to be scary, but they're going to be exciting and give yourself the ability to be surprised at the next thing that might click a little bit faster than these things have already. So, we're going to go through the trough of sorrow, we're going to go together. At this point, we need to come together as a community. This happened last cohort. Last cohort, I put out this call and it made the beautiful community that we have now. If you feel like things are clicking, please give us some of your time to help others that are around you that need the help, because I guarantee you, I guarantee you, even if You're just the most selfish motherfucker on this planet. Helping others will make sure that you do better in interviews. And if, and if that's the motivation you need, all right, let's do it. But I guarantee you helping others will get you a little bit further. It'll help solidify concepts. It'll make things stick in. And if you feel like there's some gaps that you have, some things that aren't making sense and things that aren't clicking now's the time to ask.

Don't you dare? Don't you dare? post that you're lost. Don't you dare post that things don't make sense. If you haven't been up in that Discord asking a ton of questions, popping into voice channels, hello, I need some help. Now's the time. Squeaky wheels, get the JavaScripts. Cool. Now, to focus on all this learning, To focus on this learning, we gotta do some things. The first thing we gotta do, right? So I'm allowed to if I have right? Yeah, of course. If you've done that, you can go ahead and knock yourself out. Thing you have to keep in mind, we are at the point where your health is the utmost important thing for you making it to the end. Your hands are gonna be stressed, your shoulders gonna be stressed, your eyes gonna be stressed, your neck is gonna be stressed, your brain is gonna be stressed.

You've been doing a lot of work, you've been doing a lot of reading, a lot of homework, a lot of screen time. If you don't invest in taking care of yourself right now, you won't make it to the end, or you'll make it to the end but you'll you'll probably be hurt. You have to realize that sometimes you might need to take a break, sometimes you you might need to take a breather from class, that's okay. Take that break, take that breather, do the things that you need to do. Always set a date to come back, always say it's just for this one class, right? But put your health first. If you need to take time for yourself, that's okay. Remember, this is a marathon, not a sprint. We'll always be here to help pull you along after you take that breather. Please, when we take our breaks, get up, if you're able, move around, walk around, hydrate. I'm telling you this stuff becomes really important. Don't be one of my students that goes to the hospital because they didn't stretch their fingers and hands. Don't be one of my students that goes to the hospital because they have leg pain because they've been sitting for too long. At the point now where the work is gonna get more intense and the amount of time that we're focusing will get longer. You're gonna be building stuff now, real projects, and you're gonna get into it.

You're gonna hit that flow state, right? You're gonna hit this flow state. And when you hit that flow state, you're not gonna wanna get up. Pomodoro becomes really, really important. Cool. Health first. Now, I said this is the best week ever. And so for some of you, this might be the best news of the best week ever. We're going to stop networking until May. So it's end of March. We're taking all of April off for networking because we need to focus on code. So no networking all of May. And as always, don't ever let me stop you from doing the things that you want to do. Don't let anybody that is an educator or that spouts off on Twitch stop you from doing the things that you want to do. I would love if you would take the next month to focus on the code and dial down your networking.

But if networking is your shit and you know that it's going to help you get the job, go for it. It's all right. But what I'm asking is that yet I see where folks are at right now. I feel like we need to chill on the networking a little bit. We need to focus on the homework. We need to focus on the reading. We need some of that time back. We need some of that time back. If you have appointments already, keep them. If you have your coffee chats lined up, that's OK. But dial back a little bit so that we can focus on the actual code. Focus on finishing up objects and APIs in that transition into a little bit of theory and then back end. Cool. So no networking until May. Client deadlines can be pushed all the way to May 3rd.

Some people are like, hold on, 10 second warning. I said that and some people in the background were like all right no networking all of April client deadline gets pushed to May 3rd because I want you to spend a little bit more time focusing focusing on the work that we got to get done the reading the tutorials that we're gonna do. All right. We also mentioned this idea of client alternatives. If you've given it the good old 100 devs try, or you're in a position where you can't get a paid client due to visa status or anything that might cause you harm, there are two alternatives that you may do. And this is for everyone. So if you really feel like you've given it whole bunch of devs try, you have really exhausted all the steps we talked about in our freelancing class, here are two things that would also count. The first thing is volunteering for a grassroots organization. A group that is a community group that's on the ground doing great work, probably in your local area. It's okay to approach them, ask if they need a web presence to see if they want to get a website built, and you can do that for no money. Notice I didn't say free, cause it's not free, but you can do it for no money. Now I'm distinguishing here between like a grassroots organization and a nonprofit, just because nonprofits typically have some money. Like some of the biggest clients I've ever worked with have been nonprofits. And so a lot of more established, they've been around for a while, nonprofits actually do have a lot of money. Whereas a lot of newer kind of boots on the ground type organizations might not have any collective funds to pay for a web developer and could get a lot of benefit out of your services that you're volunteering.

However, when you volunteer your time, you still do the exact same process. you still do a proposal, you still do a contract, you still say that there are terms in which you are going to be paid and how you are going to be paid is that you are asking them that when you complete the services that they will be the best reference customer that you have ever, ever had. And you put that in the proposal, you put that in the contract. It's no money down, but you are signing up to be the best recommendation that I have ever had in my life, right? And so the idea here is that this will help you when you get into the job search, because the employer can actually talk to someone that you've worked with, that you've done amazing work for, and that'll help you get past some interviews or seal the deal on an offer. It can also help you land other paid clients. So, if for some reason you're not able to land a paid client or you have a situation where you're not allowed to, then this could be one of the first really big things that you could do that still helps you in the long run of getting a job and eventually developing and getting those other clients. Is it okay to skip the proposal and go straight to the contract? I don't think so. I want you to get practice, right? All of this is practice. The first time, do it the traditional way. After you've done a few, you can see what you like, what you don't like, and modify the process to your liking, but get that full experience first. Yeah. When employers talk to our clients, and they ask if they paid us for what we built them, Most often not sometimes they will and you'll just you'll just coach your your your person to say if someone asked you Did you get paid say I'm not comfortable disclosing how much we paid So when you when they say I'm not comfortable disclosing how much I paid that assumes that they paid But really they didn't they just don't feel comfortable disclosing it That's the big brain plays that play right here.

That's all I got to say. So yeah, so grassroots volunteering, AOK in my book to satisfy the requirements of getting a client. The next thing that you can do if for some folks, they can't even volunteer depending on their situation. And so if getting a paid client isn't a thing and you can't do grassroots volunteering I think this is the best the second best thing to do is the grassroots volunteering if you can't do this the the last thing that you can do that can be really beneficial in the job search process is Contributing to free software or open source projects And so you would find a project that you're passionate about something that aligns with your interest and Contribute some code to that project and the reason why this can be really helpful with the job search is that you're gonna be working with real engineers Shipping real code that makes it into real products And so when you're in an interview and they ask like what have you built you say? Oh, do you know X Y & Z project? well, I did this thing for it or I worked on this feature for this project, and you can explain the code that you've written. You can see that code live on GitHub, which we'll learn about on Thursday. And once again, it's one of those things that can take the new developer stench off of you. Right? And so there are some ways to get started with free software and one of the best ways to do it is this website that I have linked here on the slides called First Timers Only. First Timers Only is a collection of projects that are super welcoming to folks that have never contributed to free software or open source projects in the past. And so you can go through, you can see the projects, you can see if there are any that like align with your interests, and you'll find hopefully a community of engineers that are welcoming and want to see you contribute for the first time. And so it's a really great place to start if you know you want to contribute to free software open source, or you can also just look for projects that you're interested in. There are so many things out there that are aligned with your interest that you could find and talk to the organizers of that project to see if there's anything that you could add. A lot of my students get started maybe just like cleaning up documentation.

It doesn't even have to be necessarily code to get your feet wet. It can be other things that until you get comfortable with the project how they do things and then work your way up to code As well, so first timer only is a great place to start But also don't be afraid to reach out to projects that you like. For example, like if you like chess, there's Lee chess It's a wonderful community of developers that are building a free chess server. So you could do that, right and so if you can't Do a paid client or you've given it the full 100 devs try you tried everything on that list The two alternatives are volunteering for grassroots org, but you still do the whole process or contributing to free software Cool I'm gonna try and do it all a turn up Does it have to be in JavaScript no, but you'll probably bear maybe a little bit better if it is JavaScript Especially since you're going to be using your JavaScript skills to apply to jobs and showing that you have built a project or contributed in JavaScript can be helpful. Does it help to volunteer for organizations that are like a little bit larger? It can. It's a great way of networking. Volunteering has always been the best thing I have ever done for networking. Volunteering at conferences is how I've made most of my adult friends. So yeah, it could be a great way to meet people. It can be a great way to get engaged with a local community of engineers and that you now have a common bond between. So I'm a big fan of volunteering, whether it be for like code contribution or just like in general to some other organizations in your area. I have a client, but the only one do a Shopify site. Does that count? Hell yeah, as long as they're paying you monies.

Is streaming a good networking opportunity do you think? Absolutely. It's actually one of the best things you can do to build a small community of engineers that know who you are. The only problem with streaming is that it's not localized, so you get a wider net, which could be helpful maybe for remote positions, but if you're looking for local positions that's the only downside. side. The Squarespace account. Hell yeah. If they're paying you for it. Outreachy is an open source internship for, for folks. Yes. So if you are looking for, if you are a person of color, if you're a non-traditional kind of individual coming into tech I I hate that word. But if you're looking for kind of like a good place to get started in free software, Outreachy is a really good place to do that. What they do is they take folks that are not traditionally represented in tech and they pair them up with really big orgs, like Mozilla, right? Or like any other big free software companies. And they actually pay you a stipend over the summer to work on those projects.

And so it'd be a great great place to start I can share that in our follow-up after today's class on discord Yeah Major league. Nope, that's not true. There's a lot of other things that they look for as well Now there's a bunch of things that are kind of like they fall just folks that are not traditionally in tech Cool. So we have our alternatives which are contributing to Grassroots Orgs and we have contributing to free or open source software. Check out First Timers only as a good place to get started. I'll share some other folks, I'll share some other folks, other places is to get started as well in the follow-up today's class. Cool. Alrighty. Monday, we are doing our live portfolio and resume review. So we got a bunch of things that are coming up this week. I've asked for you to submit your portfolios and resumes. So Monday, we are going to have our roast session exactly. We're gonna have a row session. It's gonna be a class on Monday. And of course, it'll be recorded if you can't make Monday.

But like I said, this is the best week ever. So we're doing something every single day of the week. So if you can't make it on Monday, it's okay. It'll be recorded, but we're gonna go through as many folks as I can in about an hour or two, looking at portfolios, looking at resumes, looking at the things I think are super important to have in part of your portfolio and your resume. And then at the end, I'll share good templates for your resume and templates for your portfolio as well. All right. YouTube was a little behind. I am almost caught up with YouTube now. A lot of folks use YouTube to watch the videos. Sorry, I got a little behind on them. They're caught up now. We, our first class on objects is on there and you'll see the next class on objects come up tomorrow. So the the the YouTube is always going to be a day or two behind because of our contract with twitch But I try to get them as quickly as possible Always appreciate folks that watch on YouTube if you're watching on YouTube, please give it a like that's all I ask It really does help the the algorithm for more folks to find it on YouTube, which is always Wonderful because then more folks find out about 100 devs and they find out about a boot camp where they don't to pay a lot Of money or any money at all. So that's the goal YouTube is very finicky. I noticed like if I post at the wrong time or I miss a day or two, like our numbers just tank.

It's pretty wild. Like the difference between like 3000 and 1000 is just like posting at a different time of day. It's really interesting. So if you're on YouTube, please give it a like, leave a comment. It really does help the algorithm and folks finding us on YouTube. And also if you're just trying to watch the classes, YouTube doesn't have any ads and it's easier to jump around to. Alrighty, newsletter. If you're part of the newsletter you might have noticed today that there was a special newsletter raffle and so I'm gonna go ahead and take all the responses from the newsletter raffle today and we're we're gonna pick a random winner and that winner will be getting a 100 devs t-shirt. That's right folks, 100 devs t-shirt coming your way for the winners of this special newsletter raffle. If you didn't read the newsletter, you didn't open up, you didn't submit the raffle too late. All right, so I'm gonna grab these here. I love all the people doing it like right now as I'm in it. So I'm grabbing from before I set it, from before class started. All right, we're gonna go from here up. I would say I'm just grabbing all the names so we can put them into the name picker.

Alright grab them all let's do a random name picker Boom 1300 of y'all before I said it. So let's go ahead and pick a random name three, two one Boom Jerkson a thank you for opening the newsletter Send me a mod mail, please on discord. I send a mod mail and we will get the We will get the T-shirt your way, congratulations. See folks, it pays to open the newsletter. It definitely pays to open newsletters on the best week ever. Imagine that. Your newsletter was going to junk this whole time. ConvertKit's pretty good about delivering the letters, but I would always appreciate If you like whitelisted my email that way your emails always came through and if you use gmail Adding it to primary just so you always see them. It really does help For some reason those ratios in terms of deliverability really help. So I appreciate it All right The next big news we have is that well we have stream tonight Well, we also have a stream tomorrow folks, and it won't be me. I want to welcome, hello, it's Rufio to the stream team. Hold on. We got a 10 second warning here. We just got to do a quick, quick confetti. I think this is appropriate for this.

All right. Welcome, welcome, welcome to the stream team. I'm so excited to have them. You'll notice there is a stream team channel in the hundred dev section of our discord Members of the stream team can post there and I will ask that you turn on notifications for that channel You can like turn on notifications for that channel that way when folks the stream team go live you get a message Just like you get a message from me So we're gonna walk through that this week on how to do that. But the first new member of the stream team Welcome, and tomorrow they are streaming normal time, 630 PM, they're going live and they're working through some code wars. So many folks have been struggling with code wars, don't know how to get started, don't know how to approach the problems. And so they are going to take the time to make sure, right, that you feel comfortable and you can see, you can see their process, right? They're going to share kind of how they do it. You can ask tons of questions. And so I'll be hanging out there tomorrow. We're going to do some raffles over there as well. So you definitely want to come hang out. And so tomorrow night, 6.30 PM, if you want to do some code wars, come hang out. And welcome to the stream team. Thursday, Thursday, sponsored stream.

So, not tomorrow, Thursday night we've got a sponsored stream, so tonight we have day one of Best Night Ever. Tomorrow we have, hello it's Rufio, streaming for the first time as part of the stream team. They do amazing streams by the way, just building wonderful things, great community, talking with folks, building, you're going to have a lot of fun, I'll be over there tomorrow. Then Thursday we have a Microsoft sponsored stream, we're wilding out folks, we are wilding Now, we have so much swag from Microsoft to give out. We have some laptops to give out. I'm matching swag as well. I'll explain that in a second. And so, come back Thursday for normal class. It's a Git and GitHub class. We're gonna make Git the terminal and GitHub make sense. And it's sponsored, so you're gonna come and have a fun time. If you haven't yet already, part of the homework was to click this link and When you click this link There is this like email form if you fill out the email and you let Microsoft send you some lovely lovely Emails because they are sponsoring a stream for us where they're giving a ton of swag and they're giving away laptops And they're supporting the hundred devs community if you give them your email You will be entered into another laptop raffle so you definitely want to do that. And then you'll notice I'm going to. I already submitted it, so I'm going to skip, but you shouldn't skip. You should do it.

And then. You'll notice that there are two resources here getting started with GitHub and introduction to GitHub. I want you to do the introduction to GitHub, please. That was part of your homework after you've done the video that I shared. So if you haven't yet, please go ahead and take a peek at this introduction to GitHub before Thursday's class. And as always, homework is a first pass. We'll always do the complicated, the important bits together during stream. Cool. If you need that link, you can do !ms in chat, and it'll give you this link if you don't have the slides pull up. Yeah. Cool, cool. Then Friday, we're doing Friday with Friends. That's right folks, tonight, tomorrow, Thursday, Friday. We are doing Friday with Friends. It's gonna be our first session of Friday with Friends.

Friday with Friends is going to be spaces. We're gonna do mainly kind of Discord spaces where you can have events on Discord. We'll probably do a few on Twitter as well, but it's just a place for us to bring folks that are part of the community. It's a way for us to bring alumni to come talk to you, to bring other folks that wanna help and support the 100 Devs community to come together. So we're gonna kick off Friday with friends. We're gonna try and do it quite regularly in the beginning and we'll see how it plays out. But the idea here is that Friday, we're having Friday with friends, 6 p.m. on Discord. I'll share more, a few surprises to be had, maybe a raffle or two, I got you. All right, Saturday, told you, best week ever. We got something every day of the week for you. If you wanna be here, you wanna be with community, you wanna be with us for the whole week, I got you. This Saturday, well, April 1st, which is technically Friday, Our Place is coming back. For folks that don't know, Our Place was one of Reddit's open, been one of Reddit's April Fool's pranks from, I don't know, like 2017, I think it was. And what it was is an all out battle to place tiles on a map.

It's one of the funnest experiences I've ever had on the internet. And since so many of us have come from Reddit, I thought it'd be really fun to battle it out to hold down our place on our place. So, Saturday, there will be a channel on Discord for folks that want to organize and try and lock down a place on our place. I think we have enough folks to do it. I think we have enough folks on Reddit to do it. So, I think that'd be a fun project for all of us to work on. It'll be something fun. Come hang out. We'll be in voice channels, we'll be in text channels that will open specifically for our place. Here's what it looked like last time. And so you can just see kind of like all these communities that came together to kind of capture Their little slice of place. We had the blue wave that was constantly trying to take over You had different countries showing out different communities showing out. And so I think we could hold it down I think we could figure out how to Hold down a little slice for a hundred devs So Saturday if you're looking to have some fun, you want to hang out with a bunch of your hundred devs members come through on discord We're gonna have a lot of fun and try and hold down a spot on our place well Baby Jacob congrats, that's great. All right Office hours Sunday, baby. Come on the best week ever.

We got to keep it coming. We got office hours on Sunday We're gonna do the thing like we normally do have a lot of fun. Maybe a little bit more fun than normal I don't know. You got to check it out Then Monday we kind of already mentioned it. We're calling it mentor Monday We are going to have a place for folks that want to be mentors in the 100 devs community Or folks that want to support the 100 devs community We're gonna start off by having a little session on like how to Help folks with portfolios and resume reviews and then we're gonna do the live portfolio resume review. So You'll alumni you'll be getting a message from me because that's where we'll start with mentor Mondays and then we'll kind of start opening it up to more and more folks. But the idea is that we want to start building systems and helping train folks in the things that I do every day. I want to help other folks learn how to do those things so that they can support our community as well. So we're bringing Mentor Mondays to fruition in the best week ever. And then after that kind of chat session with the alumni mentors, we will go ahead and do a portfolio and resume review that'll be live. So that portfolio resume review will be live at 6 p.m. 6 p.m. I forgot to put 6 p.m. On there Yeah When is our place taking place? We're gonna be having it open all weekend.

It's gonna be all Saturday. It'll be open We'll leave the channels open and so you don't feel like it There has to be a specific time just come hang out if you want to try and hold it down All right. All this is Eastern Time. Yep already and then Next Tuesday is the best week ever. The end? Hmm. Well, it's got, as the gift says, it's gotta be a banger. So next Tuesday, we're doing it really big. A lot of things that we're kind of just laying the groundwork for today, next Tuesday. Next Tuesday's a banger. Cool. So, so best week ever. We have a thing that people have been asking for for a very long time and that is merch. So I wanted to bring merch back and we're going to start with a very, very limited run. I want to show you the OG merch that everyone has a chance to win with the raffles on Thursday and tomorrow and the rest of the week.

So the the og merch will be available soon now a few of you Tried to get into the chat early. I saw you throw in the the exclamation point merch into the chat. You got gap None of this stuff was live You couldn't you couldn't get it until I until I pressed the magical button So it's gonna sell out I think pretty quickly just so everyone knows All the merch is at cost so as cheap as I can set the metric is how cheap it is there's no profit on any of this except for one thing every single time I do a merch drop I have one thing that has the max profit and that max profit item is always something that comes along with the only fans match so the max profit item always has an only fans match and so I got to get paid for my only fans and so it's like I think it's like a 20 buck profit or something like that it's always supposed to be a joke but somebody always buys it so it's know that it's a joke I don't want you to buy it but if you do when the first person reaches only fans you get only fans too that's right folks it's how you get it's the only way in you get a million channel points or you buy the the only fans match so nothing showing up yet because I haven't clicked the magical buttons. But I can go ahead and click those buttons now. So let's go ahead and boom, boom, and boom. There we go. The merch should be live. You can do exclamation point merch and stuff will come through. You might have to give it a little bit of a refresh, and then you'll see it come live. Oh boy. The they're, they're off to the races here. Um, I'm going to pull up my merch panel here just so I can, I can see it. Make sure everything's working. Go to the store. Oh, yeah, it's live folks.

It's live I can bring it on to the window here. You can see the Three lovely items that are up we have first and foremost the special cut of the Engineering v1 and then we have the another kind of cut of the engineering V1. They're limited quantities of both. And there's only one OnlyFans match. And so that's super limited. And looks like we're good. All right. I think it should be live. All right, there we go. Alright folks, have fun if that's what you want. And that's what we'll be giving away for the raffles this week. Let me pull it up real quick. This is what we'll be giving away for the raffles this week. The regular kind of two t-shirts, whenever you win a raffle, you'll get to pick either one of these cuts, whatever you like, and that'll be coming your way. Uh, if you're getting server errors, I'm pretty sure that they sold out, but don't worry.

Don't worry. Remember I said Tuesday would be a banger, so there'll be a lot more merch on Tuesday as well. Some other fun things. Uh, these are the OG ones that I wanted folks to see. And um, so they knew what they were getting with the raffles this week. I think some folks found the donation page. Hey, thank you for the donos. I appreciate you. Alrighty. We did merch and the last thing I want to do, the best week ever would not be a best week ever without thanking a lot of people. Oh, I forgot to turn up that sound off. Well, if you bought merch, I think you're about to pop up here. Sold out faster than the PS5. Yeah, there wasn't that many that were available. I wanted that many that were available.

I wanted to do a test run real quick to make sure it still worked and for folks to see what was coming up with the raffles. But I'm pretty sure they sold out in two seconds. But that's all right. Tuesday, we're gonna do another drop. Tuesday, we'll do another drop. But like I said, it wouldn't be the best week ever without thanking a lot of people. Jason Derulo, hey, thank you for the gifted subs. And so throughout the best week ever, I am going to do my best to thank some folks that are amazing contributors to this community that have shown up for us time and time again. Not right now, not right now, but I wanna give them a special place in each of these places that we meet this week. So this week we have all these events. We have an event tonight, tomorrow, Thursday, Friday, Saturday, Sunday, Monday, and next Tuesday. And so over this time, there are some really important people that I wanna thank. And so each day you're gonna see me highlight somebody different that has been an amazing part of this community. And I think that's really important for us to do. So when you see them get shouted out, give them some love, give them some praise, cause they absolutely deserve it.

But before we kind of get into the rest of the night, I also want to thank every single one of you. This has been an amazing ride. Nobody has ever done what we've been able to do. This many folks all learning to code at the same time, supporting each other, building each other up, making sure that we all get to the finish line at this scale has never ever been done. And so thank you for helping build what is hands down the best community to learn how to code live online right now, hands down. You go on our discord at any time of the day, there are folks answering questions, there are folks in discord channels. I could have never guessed a little over a year ago that this is what would become of just a few classes on Twitch. So huge, huge thank you to every single person that comes up, that comes every single class that puts in the work when things get hard that doesn't give up on themselves, when the things aren't sinking in gives me the trust to know that we'll figure out how to get there together. That like stuff that retweet stuff that helps other folks that are hurting and could use this opportunity to find us. I know it seems really silly, but when you thumbs up stuff on YouTube or you retweet stuff on Twitter, that helps more folks find us that's folks that don't have to splash out big bucks for a bootcamp that can join the catch up crew or learn at their own pace and have the support of a super strong community to help them make it to the end. And so for every single person that's ever done anything that shows up that likes that retweets that does even those those things that you think might be small but have a huge impact. I am overwhelmingly thankful. So thank you to each and every single person that shows up. And as we go throughout this week, I'm going to take time to thank these folks that have helped build this community over the last year. Cool.

Everybody. We are at the top of the hour. This is the best week ever. I know I had to take a little time to do all these things, but what, What a what a good start to the best week ever. We got some amazing merch. We got some Amazing events all throughout this entire week Let's go ahead and bring our timer up. Remember we got to be healthy even even during the best week ever We got to be healthy. Let's go ahead and bring up our timer Please if you're able get up move around hydrate Kiss some babies play with some dogs And when we come back in five minutes, we're gonna jump into our review We're gonna review a little bit of everything a little bit of arrays a little bit of objects Start to have some fun and then we'll take it from there All right, folks five minutes on the timer. You got this. I'm gonna run some ads. You actually take a break. I'll see you in five Let's get started. week software engineering bootcamp all right folks 10 seconds then we're back negative 10 shirts ghost that's hilarious have these alerts been coming in while we were on break What do I think of Webflow? I think it's a cool tool to have in your tool belt. Yeah, they have.

All right. Welcome back, folks. Let's jump into this. Let's get some review on All righty, I'm going to chill those alerts because I'm pretty sure they're probably pretty All right. There you go. We're going to, there you go. I think the alert should be done already. Folks. Let's jump into it. Let's get into our review this evening. All right. Programming. What is a program? A program is a what chat. Give it to me.

What's a program So the act of programming is simply writing those instructions in a language the computer can understand. The language that we choose is JavaScript because we can learn one language, use it on the front end, and in just a couple classes use it on the back end too. It's highly in demand. And it's something that we can use to communicate our ideas to each other. Beautiful. All right, we learned about variables. Variables are a way of storing a value into memory to be used later on. We can do both declaration and assignment at the same time. There are a lot of new folks here tonight. If you're new, this is gonna be a very quick review. We're on class 23. You can always join our Discord, Exclamation Point Discord. Get all the materials you need if you want to follow along today or join our catch-up crew and follow along at your own pace until you can join us live. Alrighty. We learned about conditionals, where we check to see if something is true.

If it's true, we do what's inside the curly braces. Otherwise we move on to an else if. We check to see if what's true is there. If it is, we do what's inside the curly braces. If not, we move on to the else. The else does not have a condition. It automatically runs if nothing else above it was true. and you can have as many LSIFs as you would like. We can always have multiple conditions as well, separated by the double ampersand. If your name is Leon and your status is Ballin, it's the best week ever, so you bet I am. You get a wink at the camera. Alrighty, we can also have or. Study time, hey, thank you for the raid. It's been a minute, how have you been? We gotta get folks coming your way.

Hold on, that's cool, we haven't seen you in a minute. Hope you're doing well. Let me do a shout out here. Study time is one of the best folks to be following. If you're going through this bootcamp and you're not following study time, you have to. And I'll explain why in a second. Let's see if I can do this here. There we go, all right, we got the shout out. Let me see if I can just copy and paste that a bazillion times, cause there's so many folks here. Boom. I'm just gonna copy and paste it. There you go. You have to give them a follow. Go ahead and give them a follow. Beautiful.

So, study time, amazing. Pomodoro sessions where you can get actual work done, super chill, super relaxed. If you haven't please give them a follow. I'm lurking in there quite often when I need to get stuff done I'm hanging out there. So if you haven't go ahead and get study time to follow. Thank you for the raid Hope you're doing well. Hope your stream went well today. Hope you were to get stuff done Welcome All right We got a I'll send you a whisper. We got to get folks. We got to figure out a raid We got to figure out the timing right so we can get more folks to come over your way because I feel like a lot Of folks in our community could could benefit from your streams. So we'll make it. We'll figure out how to make that happen All right. We also have multiple conditions for those that are actually coming over that are new We're doing a free 30 week software engineering boot camp here live on Twitch And so we're just getting some quick review of some of the topics that we've already covered so far All right All righty, so multiple conditions, we have day equals Saturday or day equals Sunday. If it's Saturday or Sunday, we will see it is the weekend. Functions, what are functions, chat?

Give me what is a function, please. Set of instructions, exactly. Set of instructions, simply a set of instructions. The set of instructions are reusable and they become the building blocks of our programs. We can separate out these functions into individual pieces and use them as needed. We have our function declaration and our function call. Whenever we call, we call to argue. We pass in our arguments and they fall into our parameters. wherever we see the parameter, it's the values that were passed in. An example is when we call the function yell, we pass in the argument of hello, wherever I see word, it is indeed hello, and we would alert hello. Wonderful. Loops, chat, what are loops? Yeah, whenever we need to do something multiple times, We can use a loop. It's just a repeating an action multiple times. There are a couple of kind of main loops that we started with like for and while.

It's, you know, a bunch of other loops now, specifically due to methods that are tied to arrays. We saw for each, we saw map, we saw reduce, all these things that are looping through and doing something multiple times. I love it. For loops, we start with our counter. We say when our loop stops and how much our counter goes up by each time. So this would console log all the numbers from one to four because by the time we got the five this is no longer true Alrighty, we got some review in let's do a turbo Review you're gonna notice some of the questions look a little familiar Know some of the questions look a little familiar So go ahead and open up turbo review If you don't have the starter code for today Make sure you join our discord exclamation point discord agreed to the rules and then the following materials channel You'll find the zip file for today in that zip file. You'll find the turbo review There are some variable questions some function questions, and it looks like these function conditional loops might be a little similar Get them done get your active recalling get your spaced repetition in and we're gonna put here come the flexesaurus Let's let's put let's put let's put a solid eight on the clock Let's do seven. Let's keep it spicy. Let's keep it spicy. Don't copy and paste. Do it from scratch. I see you. No way. You type that fast. Get out of here.

All right, folks. Seven minutes on the clock. You got this blah at it. Two more minutes. Thank you. Blah. So this becomes a nine minute timer. All right. Nine minutes on the clock. Folks have at it. You got this. Keep it spicy. Thank you, blog. You got this, dig in, try your best, give it the old 100 devs try. Some of these variables and function questions, they're gonna, you're gonna need to maybe Google some stuff to figure out how to do it cause we might not have covered those methods yet.

So for folks that have done the turbo review before, There are some different questions here No violence sometimes Do we have to use conditionals, uh, no not if you don't want to you figure out other ways go for it Looks like I'm sipping wine now. I promise you it's just it's just water and some some berries Man these merch alerts still coming through Thank you to everyone that bought the merch that's pretty cool. I'm really excited to see y'all rep the hundred devs og merch Would it code? I opened up a Slido for the, for the clips. Well, that's called bomber's peak. Yeah. It's like a certain level of intoxication where it helps the coding and then an immediate drop where it no longer helps. Yeah, Nora lockstick as long as cheap as they'll let me sell them is what I sell them at. There's no profit on any of them. Charlie said, will you restock? Absolutely. We'll wait, it's 30 time rate again. How's that possible? Did you go live and then come back or is that, or is this the alert just coming through now? Did the alert not come through?

I guess because of all the merch alerts. Show study time again. Definitely need to hang out there if you're not already. How do you feel GitHub copilot, bad idea to use if you're just learning? Yeah, I think in the beginning, try and do things that make you have to learn the syntax. And then as you get comfortable with a language, Then you can use tools like that for sure That merch should have worked for anyone we've had folks from all over the world be able to get the merch through that link so Um, i'll double check to make sure there's no settings on my end or anything like that But it should have worked for other any folks. I think it just sold out really really quick ours now keep keep following through um you there's the there's the newer videos of cohort two i might use those instead of the the other cohort um just so that you're a little bit closer to what we're doing this this year um and join the catch-up crew and discord get through get caught up and then join us live except for office hours um office hours i think you should still will come through. Oh, and for folks, I'll mention this again when we're back, I know folks mute me during the work time, but I know that everybody can afford to buy merch. I try to make it as cheap as possible. It's $10 for the t-shirt, but I know that that's not a privilege everyone has. And so for all the swag that Microsoft gives, I match with like random giveaways for for swag. So hopefully there's a chance for you to get a shirt, too, if you really want one. What if we can't attend every stream this week? You don't have to. It's just for us to have some time to celebrate.

Come as you can. Don't worry about making them all. I know a lot of folks have other commitments in life and jobs. And so, yeah, no, it's just just for us to have some fun. It's not it's nothing that you have to commit to What's Wednesday, it's hello. It's Rufio's first stream as part of the stream team. I Got you dab It'll be on their own, yep, it'll be on their own. Can we win the laptop if we aren't in the US? Yes. I ship anywhere. In fact, it was like, I, like a month ago, I just started getting back merch that I sent last year, like, like I had shipped out some stuff and it just didn't make it. Like I sent it to some, some places that I mean, it was, it was a crapshoot if it was going to make it there, but we tried, um, and they got, they got returned unfortunately for some places, but I'll try, I'll try to ship it anywhere I can. Uh, yeah, they'll hear back from mod mail. Uh, we're, we'll probably won't be responding about like raffles until the end of the best week ever, just cause there'll be so many. And then on like Wednesday of next week, I'm just going to go through and set up everything so that way I can ship everything out.

But yeah, you'll hear back from me probably like next Wednesday. day if you win something like at any point this week. Can't do the first question. That's okay. This is I don't expect you to be able to know how to code this. These first two questions were more you Googling than you knowing how to solve something. Yeah, these first two ones are not things that you should know is something that you'd Google to figure out three you can do exclamation point semicolon in chat and and you can read about all about it. It's with the first time chat, just to drop the dunzo on us, I love it. That's how you use your first time highlight. We learned Docker, some folks might pick it up Based on like if they do a free software projects, but it's not something that we'll go deep on or like really cover in class Or something that you might pick up on your job on the job Don't catch up and then join us live once you're caught up. Oh One yeah, we sold out within like a minute Yeah, I use docker all the time, I love it. Alrighty folks, come on back, come on back. So yeah, you're eligible if you come to, you gotta be in the class though. Yeah. Thank you, Sammy.

All right. Come on back, folks. Let's go over this together. But let's look at some of the new ones and we'll get the review together as well. Will Friday's best ever be recorded? Yeah, everything that we can record, we'll record. Yeah. And we'll at least share it on Discord. Cool. Alrighty, declare a variable and assign it to a sentence as a string. Alert if that sentence is a question. How do we know if a sentence is a question, first of all? Yeah, it ends in a question mark. So we would need to figure out whether or not our string ends with a question mark. So, what did you all figure out you could use with strings to figure out if a string ends with a question mark?

Includes could work. Some folks found ends with. Yeah, that's what I think I would use. So, if you gave it to Google, you might've come across with ends with. So, let's create a string. Const, because this is never gonna change. Let's say, we're just gonna call it a string. I'm going to say, is this the best week ever? Oh yeah. And so what we can do is we can alert if the sentence is a question, because we can just go ahead and alert and we can pop in here, str ends with, and we can just pass in the question mark. So if this ends with a question mark, right? All right, if this ends with a question mark, what do you think we get? Let's go ahead and save this and see if it works first. Open it in the browser. All right, we get true.

Boom, we get true. So we know, oh yeah. Fuck yeah, let's go. Oh, beautiful, all right, thank you. Yeah, those turbo fits are, I'm digging that. Oh yeah, all right, so we did get true. And so what do you know ends with returned? What did it return? Yeah, return that true or false value. And then we simply just alert it that true or false. So we know that our string was a question because it ends with a question mark. Now, there's no way that you would know this unless you had read it in some readings or had maybe come across it on the MDN. This is something that you had to Google, right? Oh, because where is the function? Exactly, it's a function.

We're passing this in. What I have highlighted right here is technically a what? What I have highlighted is a what? It's an argument. Like if I was to break it down, this is a method on a string, but right now we're passing in that method on the string in as an argument to the alert method, right? Pretty cool, but I think there are some folks that were like that. They're like, there's no way I could figure this out Ah, they just had you just had to Google and so getting better at googling getting over that initial There's like that thing in our brain that goes. I don't know how to do this. I know how to do this I know how to do this. I can't do it. I'm gonna do it. I'll never forget. I can't do it I can't do I can't do I can't do it can do it Got it you got to figure out how to turn that off This had nothing to do with your ability to code JavaScript. This had nothing to do with how much you understand. This was all Google.

And so sometimes we have to turn off that thing in our brain that says we can't do it. I don't know where to get started. I don't know what to do and just fricking Google it. Well, I'll say I just spent 3.5 work days Googling various things to untangle a bug, days and it's okay. Exactly. This is what you do on the job. You sit down, you go, fuck, I have no idea how I'm going to solve this. And then you Google your ass off for three, three and a half days. Like Blal just did. That's being an engineer. So when you get a question that you just have no idea, you got to fight that feeling, that thing that says you can't figure it out and just Google it and spend time developing that skill set. because it's what you're going to do on the job. And it gets better the more you do it. All right. Declare a variable, assign it a string of multiple words, replace every junior dev with software engineer and print it to the console.

All right. Let string equal. I am looking for junior dev positions. There we go. I am looking for junior dev positions. Nah, not what we do. It's not what we do. All right, cool. So let's go ahead. What could I do to replace every mention of junior dev? Replace, that can work, maybe once though. Replace all, yeah, let's go ahead and do replace all. So we need to print it to the console, so we'll do our console log. And then inside of our console log, we are going to do string, or str, and we'll do replace all, and then replace all takes in two values. it takes the thing that you want to replace.

So in this case, it'll be junior dev. You got to make sure the spacing is correct. And we're going to place it with software engineering. All right. So what this will do is it'll replace every junior dev with software engineering. Let's go ahead and save this. All right, let's save this. And let's open up the inspector. Console. And let's go ahead and refresh. Uncaught syntax error, str has already been declared. What happened? It's saved. What happened? Yeah, we've already declared a variable called struh and it's a const.

So there's no way that we could even override it down here. We're never changing our string to be that we're looking for junior depositions. Get the fuck out of here. Where have you been? He thought this was what we were going to leave it as. So we got to use a different name. Let's do string to change. There we go. String to change, so I get a little excited every once in a while, it's the best week ever. String to change, and we're gonna replace it all. So let's save it, let's go back, let's refresh. True, and I am looking for software engineering positions. Let's go, turn up, we got this. Second try. All right.

Next one, this is where it kind of gets similar. We've kind of seen these next three questions already, but that's okay. Let's take some time and go through them Blunder no Alrighty Create a function that returns rock-paper-scissors as randomly as possible But what are some things we're going to need to do this randomly? What are some tools we're going to need to generate rock-paper-scissors randomly? Oh yeah, when it gets to the bottom, that's when you know you're doing good. Math.random, exactly. All right, so let's go ahead and we know we're gonna create a function that returns rock, paper, scissors. So I'm just gonna call this function rock, paper, scissors. And we're going to return either rock, paper, scissors. But before we do that, let's go ahead and create a variable that'll hold our random number. So let's say let random equal, then we'll do math.random. And math.random, in case you forget, returns a number between zero and one. So we're gonna get a decimal, some number between zero and one. And so if we wanna do it equal values, we'll do a conditional, and we'll say if random is less than what? 0.33, exactly.

If it's less than 0.33, let's go ahead and return rock. We'll return a string of rock. Else if random is less than 0.66, we will return paper. Beautiful. And if it wasn't less than 0.33 or less than 0.66, the only other thing it can be, the only other thing it could be, would be greater than 0.66. So we can just do an else. And in that case, we'll return scissors. Beautiful. Great. So now we have a function that we can call that will return rock, paper, or scissors. Wonderful. Create a function that takes in a choice. That takes in a choice. Could you use fractions instead of decimals? Probably, yeah.

Just make sure you use your parentheses to keep it separated. Could you make it into an arrow function? You could, but I think this would be way more readable the way it is. Yeah, I like the readability of this. All right, so let's do the next one here. Create a function that takes in a choice, rock, paper, scissors, and determines if you won a game of rock, paper, scissors against a bot using the above function. So we're going to create a function that is going to take in a choice that we use and then compare it to the choice that the bot generates using this function above. So I'm going to go here and create a function. I'm gonna call it check win. And we know that we're taking in player choice, right, the choice that the player is gonna pick. And the very first thing we have to do is get the bot choice. I'm gonna set bot choice equal to calling rock, paper, scissors. So what's gonna happen is the very first time, well, the very first thing this function is going to do is run the function we have up here. And we know that this function, right? We know that this function can spit out rock, paper, or scissors.

So there is an equal chance that this will wind up being either rock, paper, or scissors. So any, there we go. Anywhere else we see bot choice, Anywhere else we see bot choice, we know that it's gonna be either rock, paper, or scissors. That's how you spell scissors, by the way. Cool. So now we got the bot choice. We have to do our comparison. So we'll do our first conditional, and we're just gonna compare the choice of the player to the choice of the bot. And so if the player Bot choice equals rock. And the bot choice equals what? I want this to be winning conditions. So what would bot choice have to be for us to win this very first scenario? I'm gonna just put this in parentheses just to be a little safer here. Yeah, it would have to be scissors. All right, so player choice with the rock, bot choice with our scissors, that is a win condition.

Now we can check for some other win conditions using or. So if this is true, or, I'm just gonna copy and paste it actually, Or this is true. So if the player threw, let's say scissors and the bot choice threw what? If they threw, if bot choice would have to throw what for this to be a winning throw? Paper. Y'all wild. That would have been funny if I thought about it in the moment, but I didn't. All right. Scissors, paper. Scissors, paper, and we have one more or. So if this was true, or this was true, or this was true, player choice equals paper. They would have had to have chosen, the bot would have had to have chosen rock. Great. So in this case, we now have all of our winning conditions. If the player chose rock and bot chose scissors, we win.

If player chose scissors and bot choice was paper, we win. If player choice was paper and they threw rock, we win. So we have our three winning conditions separated by or, and so in this case, we would just maybe log to the console. Winner. Here we go, winner, winner, chicken dinner. Beautiful. Then we can do an else if, and in our else if we can check for a tie. We can check for a tie. What would be a tie? How would we determine the tie? Throw it in chat for me. How would we determine the try? Yep, if player choice equals bot choice. Player choice equals bot choice. Beautiful.

So player choice equals bot choice. Then we can console log. Tied. And then if you didn't win, you didn't lose, the only other thing that you could have happened, sorry, if you won, or if you didn't win, if you didn't tie, the only thing that could have happened is that you lost. loser, there we go, cool. So we have the bot choice being determined by our function up here, which is returning rock, paper, scissors. We now have the ability to randomly see if we win, tie or lose, and then we can call it. So the name of this function is check win. So we can throw in, Statistically, you should always throw paper. Like if you're, if you're picking a choice, you should, you should throw paper. Most people throw rock the first time. Yeah. It's like, it's like 60 to 70% of people throw rock the first time. And so you should, you statistically should throw paper the first time. Got you.

Now you know. Alrighty. We have our check when let's go ahead and make sure the code looks good I'm gonna give you a second to look at this rock-paper-scissors Looks good Look at the check when see if it looks good because we're gonna do a little YOLO my friends a little YOLO here Let's go into YOLO All right Let's just make sure it's working first Let's comment out this other stuff up here. Just so we don't have to Um, deal with that, boom, boom, save it. Let's come back, let's refresh. Oh, these Power Rangers photos are lit. All right, so we got a loser, we got a winner, got a winner, we got a tied. So it's working. You saw the code, there might be some discrepancies. I don't know, maybe I wrote some bad code that maybe swayed the options here. So let's go ahead and set up a YOLO. We're going to win or lose, win or lose, mission period is one minute. We're going to start the prediction. We win or lose. If it's a tie, we run it again.

All right. Get in here. If you want to get in here, win or lose, win or lose. YOLO those points, get your predictions in. People throwing around big points. Got this. A million channel points already up. Wow, we might have a mil on each side. Oh a milli a milli a milli. Yeah. Oh y'all showing out tonight. I see you Wow 1.6 million on each side in terms of channel points There's no timer right now Kings og a thank you for the hydration here's to you you owe me there's no timer next timer we'll do another we'll do it we'll add two minutes though all right you ready folks for all the marbles for all the marbles three two wait a minute actually let me talk about something for a second So, all right, three, two, it's going to get loud after, after this wins, right? I'm going to get loud after this wins. So three, two, one, losers win it. Way to go way to go let's confirm it Losers have it complete the prediction you got your points Oh boy let's see whoa it was 2 million on each side 2 million on each side 2.1 million for winning and 2.1 million put up for losing and Sour Sprite I think got 97,000 they spent 97,000 I can't do any more YOLOs that's it we're done I might have to end stream they put out 97,001 that's it.

That's the last yellow. We're done. Someone else has lost a lot too. Oh, that's wild. That's wild. All right. And then I always love that. Like, this is like the most like wholesome gambling ever, because as soon as someone wins, they immediately spend it on like resume reviews, portfolio reviews. So like, what did code as soon as they won their YOLO, boom, resume review. Woo. What a rush. I love it. Uh, what did code, uh, send me a mod mail, please. We'll set it up. Y'all the best.

All right, let's keep pushing. Uh, we will skip the, the loop. We already did that together. Well, come the office hours, we'll do more of the loops and fun stuff on office hours. All right. Turbo review. Done. Erase chat, what are erase? One more. Maybe, maybe, we'll see. This is the best week ever. We got a long week, folks. Cause we've got to say some of the YOLO love to go around. Arrays are indeed toasters. Exactly.

Toasters. Well done. I always hope that new people join us right as we get to this thing. What are arrays? Toasters. Woo. All right. Arrays are like toasters. It's one element or one structure that can hold a bunch of other stuff. Alrighty. The tricky thing about our arrays is they start counting. right, they start counting with zero. So the first element in the array is at the zero with index. We can create new arrays using this array constructor, which maybe makes a little bit more sense now. We have this special new keyword and this array.

What can you tell me about this array? This is really important. We haven't talked about this yet, but we know the new keyword is used to help us create what so far? The other places might pop up, But so far we know the new keyword helps us create what? Helps us create new objects. And if we look at this, what do we know this is? Just by looking at it, what is it? It's a constructor function. How do I know it's a constructor function? Because the first letter is capitalized. So built into JavaScript isn't a there isn't a way to create a new array Using the built-in array Constructor which spits out an object That's an array That's a shit ain't it that's that's that's that right there once this stuff starts clicking man, I love me some JavaScript JB Donahue A, thank you for the gifted subs. I appreciate it. Thank you for being here. So we saw new only in one place. We saw new when we were using our constructors to spit out objects.

And we'll see that again in a few seconds, but we only saw new when we were creating objects. So when we see this new keyword, we should be like, all right, As much as we know right now, it's used to create an object. And we saw it whenever it was combined with a constructor function, right? Whenever it's created with a constructor function. And we know that this is a constructor function because it follows the nomenclature that is to have a capital letter A, right? So right now we can see that this is a constructor function that's gonna spit out an object that has all the properties and methods that enable it to be an array. So when we create a new array object, what properties does this object have? What does new array now have? What are some properties that it could have? Length. Holy shit. What are some methods it could have? ForEach, map. Holy crap. That means somewhere built into JavaScript is a constructor function and that's giving it the length property, that's giving it the for each, that's giving it the map, that's giving all that stuff.

Like if we could go and like look at the JavaScript source code, which you can do, you would see that they're out of this constructor function is setting up length, is setting up for each, is setting up map, is setting up reduce, is setting up all those things that we're using. All right. Or we could just use literal notation. and who wrote all that? A lot of people over the years. The joke is that JavaScript was written in 10 days and then it had a lot of time to mature after that. Cool. When we're declaring arrays, we can pass in values, right? We can have any type of value that we've learned about so far. We can have strings, booleans, numbers, there's even other arrays can go in there. What? Seclusion, hey, thank you for the 10 gifted subs. That's wild. Thank you so much. Thank you for being here.

Thank you everybody for all the subs and bits and all that fun stuff tonight. I appreciate y'all. Thank you. Hey, appreciate it, Seclusion. All right. Arrays start counting at zero. It is the best week ever. Hey, turn out. Array index, we start at zero. So if we wanted the New York City out of this array, we'd have to use the zeroth index. That's how we could grab the first element by the index of zero. Cool. We can also get stuff out of the array using the index, and we can also put stuff into the array using the index. If you're new around here, folks, we're going through this quick. This is meant to be a lot of review.

We can also use those properties that come with our arrays like length, length will give us the total number of elements in the array. In this case, if we looked at best colors and we use the length property, we'd get four. So down here, best colors dot length, that's actually four. We can loop through our array, pulling out each color using an index. The very first time this runs, I would be zero. We'd grab green, one for blue, two for yellow, Yellow, three, four, black, beautiful. We can even use built -in methods that come with our arrays, like for each, for each we're gonna run once for each element in our array. So this case it would grab green and zero, blue and one, yellow and two, black and three. We could pass it into this arrow function. Wherever we see X, it actually would be green, then blue, then yellow, then black, beautiful. Cool. Space review. Let's pull it up, folks. Let's pull it up. Space review.

Take a look. Alrighty. So with our space review, you got some things to do here with arrays. Some of these should look really familiar. Should look really familiar. Let's put five minutes on the clock and who gave us? Yomi two gave us an extra two minutes. So we're going to put seven minutes on the clock. Thanks to Yomi two, get as far and as fast as you can. We'll go over it together and then we'll take our break. When we come back, we look at objects. We spend more time with objects and hopefully get to arrays. Sorry, get to APIs. All right, so we had five, we'll make it seven. I mean, so the timer gets far as you can.

This should if you've already done this you've already solved this great do it again See how fast you can get it if you're if you're struggling with it great do it again See how far you can get the minutes on the clock Go for it This is space review space review We'll go over it together and then we will take our break If you did it once before try doing it with arrow functions try spicing it up a little bit Time is flying. Yeah when time flies we having fun folks Move the clock down. I got you. There we go After the break, it's objects and then objects will lead us into the APIs. JB Donahue. Hey, thank you for the 1800 bits. That's wild. Thank you so much. Doing too much. I appreciate you. Thank you for the get the subs. Thank you for the bits. Thank you for being here. Honda, how many how many channel points do you have? It flew too close to the sun eh?

100 devs speedo? We did 100 devs bikini. I don't know if there is a speedo on Dreamlabs merch, but I'd be open to it if there was. Man, I gotta start practicing Smash Brothers and stuff now that people are getting closer. Ooh, Honda, you're one YOLO away. Do you risk it all? I actually gotta set it up. Now, I gotta say, I don't even think it's set up right now. So I'll set it up. I'll make it make sure it'll be set up before uh before uh, thursday in case folks do hit it That's right that you're the you're the one that got it right? Yeah. I'm glad hope you enjoy I never really played Halo that much the whole the whole idea of like shields is kind of Odd to me coming from CS Sour Sprite. Hey, they give you a 10 gift of soaps. Thank you so much for being here. I appreciate you Vlady yes, we'll be announcing all that stuff this week during the best week ever Kangaroo, not yet.

No time. No time. Three minutes left on the clock, folks. First try on the second question without looking, hey, there you go, turn out. Don, Code Wars helped a lot with this. Awesome. Good to hear. First time done before the timer That's awesome, congrats. These are code wars questions, they are. Hint, hint. Shuffle A, even in the skies, that's awesome. Thank you for being here. We don't get got even in the air. Got some dunzo's coming in that's good to see What lady in the Zilla a thank you for the gift of those thank you so much for being here Probably Evo, but a review. I Looked at the first one felt the answer hell, yeah Is it a bad thing if I knew exactly how to do these on Tuesday but forget now?

Not necessarily bad, but definitely a good reminder that you might need to do a little bit more Anki and a little bit more active recall after class. I know after class we do a raid, but you definitely want to make sure you get a little bit of review in before you kind of shut the books for the evening. Lou, whenever somebody says they struggle with maths, I ask them first, are they studying right? Do you use active recall? Do you use space repetition? Have you applied that to learning math? Because if you haven't, it's probably not your aptitude with math, which almost it never is, but more so your study habits start there. Is it bad if my brain shuts down sometimes? No, that's what it's, that's what I, it's such a good, good thing to bring up. Um, everybody has levels that they can actually focus and a lot of folks jump in learning how to code thinking that they can do 10 hour days. and just know we all have a different amount that we can focus and getting comfortable with that and then slowly pushing it up is what the name of the game is. And so like for me, like I shared my story before I started off with stuff that was wild, one minute on 59 minutes off because that's just where my attention span was. And I worked at it and I pushed it and I got up to the point now where I feel like I can focus for good blocks of time, but I'm still, I still feel most comfortable at like 45 15. I'm not even do like fly I do 45 minutes on 15 off is like where I feel like when I'm having a good day. That's right That's where my P kits All right, let's come back.

Let's do this together And then we'll take our break Alrighty crane array of numbers sum all the numbers alert the sum. All right, let nums equal 10, 20, 30. Cool. 10, 20, 30. And then we'll skip one and go straight to 50. Beautiful. Sum all the numbers. Alert the sum. What are some ways that we could sum all these numbers? What are some ways that we could sum all these numbers? We could reduce. So maybe we do an alert. And in that alert, we do nums.reduce. and then inside that reduce, we know that we have an accumulator and a current value. And we know that we can add to that accumulator, the current value.

And always for safety, we throw in the zero. Cool. Let's save this and see if it works. Oh, did I open it? I didn't open it. All right. We got one 10 in the alert. Hell yeah. Y'all that black ranges. There we go. Beautiful. All right. Let's make sure that was the first try. Yeah. 10, 20, 30, at 60, 60 plus 50 is 110, first try, cool.

So let's see what, let's talk about what's happening here. We know that we're inside of the alert, right? The alert opens and closes here. So all this stuff here is gonna reduce down to a singular number that we now know as 110, right? We know that that is 110. And so what's happening when reduce is running? Reduce is a method that only works on a what chat. Reduce only runs on a what chat. What does reduce only run on? As far as we know, yes, an array. So we can see that nums is our array. So we know that reduce is gonna use the values that are inside of our nums array. and what reduce is going to do is it's gonna run once for each element in the array. So we have four elements in our array, so reduce is gonna run four times. Each time it runs, we're gonna grab the value and plop it into the current value.

But first, current value's gonna be 10, then it'll be 20, then it'll be 30, then it'll be 50. We're just pulling the values out of this array, passing it through our parameter of C, wherever we see it's the current value. And all we're doing with reduce in this instance is taking that current value, and in this case, adding it to the accumulator. So accumulator goes from 10 to 30 to 60. 60 to 110, because what we're doing is adding each of these values to that accumulation, right? We're just adding it to the pile. That's all we're doing. We're adding it onto this pile of numbers. And so eventually this reduced all the way down to a singular number that was 110. And since we were inside of the alert, we saw the 110 get alerted. Cool. There are other ways we could have done this. We could have like a for loop that added to a sum and then alerted it, but reduces the easiest here and something that we've seen. And we definitely want to get practice with these methods. Now, something that kind of bugs some folks sometimes is that they think that this A, C, C, and C are built in.

No, these are just parameters. We can call these whatever we want. Robot and dino, right? It just doesn't matter. It's still always going to be the first parameter is always going to be our accumulation when we're using reduce. And the second parameter is always going to be our current value when we're using reduce. So it doesn't matter what we call them, it's just the fact that since we're using reduce, robots going to be the accumulation and dino is going to be the current value. It just doesn't matter what, what we do. Cool. When would you not want the initial value to be zero? If you're multiplying, right? If you're multiplying, you wouldn't want it to be set to zero. The zero doesn't actually need to be here right now. The zero helps when you're worried about types. So let's say this wasn't a number, but instead a string.

The zero is gonna tell the accumulation to start off as a number and not a string so that we don't concatenate, we just actually do the addition. Cool, but this would still work even without it. Beautiful, we get the 110, nice. All right, next one. Create a function that takes in an array of numbers, return a new array of numbers that is every original number squared. So whenever we know we need to return a new array, right? Whenever we want to return a new array, what do we need? Yeah, map is the way. Let's go ahead and create a new array and set it equal to, let's just use our nums from above. I'm gonna just do nums.map. And all we're gonna do is we're gonna take in each number and it says square it. So we'll do num equals num, and then we can just square it by doing what? How can we square num? We could do math.pal, that's one way. What else could we do?

Num times num, that's another way to do it. We could also do this too, that's another shorthand way of squaring. All right, so we could do num times num, that would be probably the clearest way. But there are some other shortcuts like that that would also square. Could also do math.pal, yeah. Remember, we're not doing square root, but we're doing square, which is different. Cool. All right. And let's just see what that would be. 110. And then, oh, do I have, was it, was it console logged? Oh, no, I didn't do anything with it. Did it say to do anything? It does say to return it, so we could do it as an inside of an arrow function if we wanted to. I'm gonna say just like nums, oops, sorry, not here.

There we go, beautiful. So now what we're doing is we have this set up as an arrow function because this right hand side has a what? This right hand side has a what? Yeah, it has an implicit return. Yep, has an implicit return, meaning that it's just gonna return that bit. Cool. All righty. This should have been kind of stuff we saw last class. Definitely make sure you're getting this review in. That way, when you see these things for the second time, you might know how to approach it. All right, next one. Create a function that takes a string. Print the reverse of that string to the console. What can we do? Oh, N's asterisk, asterisk two is just another way of squaring.

It's just something built into JavaScript that can also help you square. Yeah, we saw how to reverse last time. Split, reverse, join, split, reverse, join, split, reverse, join, split, reverse, join, split, reverse, join, split, reverse, join. It's how we reverse a string. That should be in your Anki. You should be able to spit it out whenever you need. All right, create a function that takes in a string, print the reverse of that string. So let's say uno reverse equals, we're gonna take in a string, and we are going to console.log that string split, reverse, join. Beautiful. There we go. What split does is it takes the string and turns it into a what? Howdy, Sam. Turns it into an array. Once we have the array, reverse can reverse each. In this case, we split it into individual letters.

Reverse can take those individual letters and it can reverse them. And then once we reversed our array, we join it back together to get back a what? To get back a string, exactly. Otherwise we'd still be dealing with an array, we want that string back. Why does reverse not need quotes? Because when they made the reverse method, they didn't need it to take in an argument to do the reversing, so we don't need to pass anything in. Splitting needs to know how you're splitting up the string. Are you splitting it into individual letters? Are you splitting it based on a delimiter, like a space or a comma? Same thing with join. How are we joining it back together? Are we joining all the letters back together? Or are we joining them with spaces, et cetera, et cetera. Alrighty. Create a function that takes in a string, alert if the string is a palindrome or not.

How could I do this? Create a function that takes in a string, alert if it's a palindrome or not. What am I gonna do here? What am I gonna compare? Yeah, cool. So let's do const palindrome check equals. I'm gonna take in a string and we're gonna see if that string equals that string split, reverse, whoo, almost, join, there we go. We know we're gonna take in a string, we're gonna see if it equals the same as that reversed, and we can just throw this into an alert. So we get the alert. Beautiful. So, if the string equals the string reversed, what do we know that we have? If the string equals the string reversed, what do we know that we have? We have a palindrome, exactly. And so this case it would evaluate to true and we would alert true. If this was not the same backwards and forwards, we would get false and would alert false.

So let's save this. Let's go ahead and call our palindrome check and let's pass in race car. Let's save it. Let's go ahead and refresh. And we get true. We see true gets printed. Sorry, alert it because race car is indeed a palindrome. Is it bad practice to use uno reverse? We could use uno reverse in here. We could call uno reverse with string. We could do that. We could do uno reverse and pass in string as an argument. But we would have to get rid of the console log here as we want it to return. We need it to be a return, not a console log, if we're going to do that. So, let's save it, if it still works.

Boom, we still get true. So, it's still working. So, what happened here? Let's do this together. We have our function call. We're going to pass race car as an argument into our string. Wherever we see string, it is now race car. Whenever we see string, it is now race car. And so we passed race car into our uno reverse function, which is going to have an implicit return of race car. But in this case, race car will be reversed. And so now we can compare the string we passed in with the reverse of the string using the function we did up here. This is the beauty of building out functions that do singular things because we can start to reuse them in other parts of our code. So now whenever we want to reverse a string, we no longer have to build out this code to reverse a string. We can just call it as we need it. All right, folks, let's take a break.

Let's take a break. If you need to come back to this stuff, come to office hours, we're gonna do more practice almost exactly like this during office hours. Come on Sunday, we'll be doing it together. Alrighty, let's go ahead and take our break. We come back from our break, we're jumping into our objects for quick review, and then hopefully getting to see some APIs before we wrap up today. What a great first day of Best Week Ever it's been. All right, five minutes on the clock, folks. Bring it over. Coder, thank you for the bits, I appreciate you. All right. Here we go, CN5, if you're able, please get up, move around, hydrate. Now CN5. You You You I forgot to run ads. Damn. Thank you.

I forgot to do though. Yep. Sorry folks. We get as my apologies Bob was popping off, huh? All right, come on back everybody. Let's get into some objects. Have some fun. Let's do some review And in a 1992, thank you for the hydration cheers to you Hmm, hmm, hmm, hmm, hmm, hmm. Alrighty, what are objects, chat? What are objects? Everything, true, true, but there's something specific we said. Yeah, they're collections of variables and functions. Nice, collections of variables and functions. Now, when we're dealing with objects, we call those variables properties and we call those functions methods. When we're thinking of objects, I really like to think of physical objects.

In this case, I always like to start thinking off by like a stopwatch. A stopwatch has some variables, Which we would call properties and it has some functions which we would call methods because they're tied to the object so if I'm thinking of some properties, I'm thinking that this would have a shape property that would have a value of round it could have a Brand property that would be equal to accu split It could have a model property of the pro survivor 601 X 3 V 0.1 That was a good one. It could also have a minutes property of three, a seconds property of 59. It could have a color property of black. It could have an accent color property of yellow. And there could be a lot more other properties that we could think of. Lanyard set equal to true, exactly. Water resistance set equal to true, right? Does that have Bluetooth? Maybe that can be set to false. I don't know if this one has Bluetooth. if maybe not, maybe the 602X, not the 601X, I don't know. And then there's also some methods, some functions that are tied to this object. We have the ability to start and stop. We have the ability to split and reset, the ability to chain mode.

We have the ability to beep. So there are a lot of functions that are tied to this object that we would call methods. 603 is the goat, you know it, I know. Oh, I couldn't, the 603 is just a new model. I can only get the 601 photo. All righty. We saw originally how, I can't afford the 603. We saw originally creating a stopwatch using what type of notation? What type of notation is this to create an object? Yes, nice. Literal notation. and we saw that we were able to add properties and methods using what notation here? What notation am I using to add a property of current time and a method of tell time? I'm using dot notation, exactly. I set this equal to a value of 12 and I know tell time is a method, how come?

How do I know that tell time is a method? Because it's value is a function, exactly. It's set equal to a function. And down here, I'm calling that function. I can know that I'm calling it because I have the parentheses that we'd have with a normal function call. And I'm passing in stopwatch.currentTime as an argument. So we know that stopwatch.currentTime is actually 12. The 12 gets passed in, wherever I see time, it is 12. And so this method call would wind up printing to the console, the current time is 12. Beautiful. Me too, Hydra. Alrighty. We have this object's lost galaxy code. Let's go ahead and take a peek at it. And here we have, I want you to create a dog object that has four properties and three methods.

no constructors has four properties and three methods. We're going to put a quick, you should already have the files open because you should open the whole folder. We're going to put a quick two minutes on the board here. Two minutes. You got this. Go fast, dig deep. I want a dog object that has four properties and three methods, no constructor. Go for it. Old school dot notation, please. Quick two, exactly. Lost Galaxy. Goofer no, you can do that. Lost Galaxy is a version of the Power Rangers. These are all Power Ranger names. Turbo, Space, Lost Galaxy are all runs of Power Rangers.

How many more classes do we have to power rangers team for until we get through objects I wasn't cultured enough. Hey, we can't all be. You know, Boris was my shit. You know, Boris way better. You know, Boris were my favorite show. If you if you if you grew up at UPN, we could be friends. UPN man back in the day my beetle Borgs and if you a real one that give you like a real real real one mummies alive and most people don't know about that mummies alive but that That was my, that was my shit. Alrighty, folks. Come on back, come on back. Let's do this together. All right, so we wanna go ahead and create a dog object. So we can just go ahead and say let dog equal and then we have our curly braces And then what are some properties that you gave dog? Dog dot breed equals what kind of dogs y'all got Poodle, nice. Dog.color equals golden. It's kind of fucked up.

Dog.legs equals four. And dog.name equals Fido. Cool, so it has four properties, breed, color, legs, and name. And then how about methods? What are some methods that the dog has? Dog.bark equals, we'll set it equal to a function. Console.log. What else we got? Dog dot jump equals console log of the last off, beautiful. And one last one. Dog.fetch equals, I want to say console.log.zoom. There we go. That'll be our fetch command. Beautiful. All right, so we had four properties.

Dog with a breed, color, legs, and name. and then also a bark, a jump, and a fetch method. Well done. Cool. This was using literal notation to create the object, and then dot notation to create these properties and these methods. However, if I wanted to create another dog, what's the problem I'm gonna run into? Now that's fetch, exactly. It is well done Alice word if I could give you more channel points, I would In fact send me a mod mail I'm getting you a t-shirt for that one It's really wet exactly I'd have to repeat all this code all over again I had to repeat this all over again Right, and I would have to redo the breed the color the legs the name the bark the jump the federa do it all over again So if I want it to have an easier way to create dogs, what could I use? What could I use? If I want an easier way to spit out dog objects. Yeah, I can use a constructor. Let's go. So we want to make a lot of objects. We need a factory, our factory, think about like if you want it to have a lot of cars, you create a car factory and that factory could spit out a bunch of car objects over and over again. We have the same thing in JavaScript.

We have the ability to create a function that spits out objects. So here is a make car constructor. It's a function, it's a function that spits out objects. That's it. We're using factory as an example. There are things called factories in programming. That's not what I'm talking about. I was just talking about like legitimately like a car factory. All right. Now, if we look, any car that comes out of this constructor will have a make property, a model, a color, a doors, and it will have two methods, honk and lock. How do I know that the objects are going to have a make, a model, a color, a doors, a honk, and a lock? How do I know that the objects themselves are going to have those properties and those methods? This, exactly. When I say this.make, I mean, the object itself is going to have this property of make. It's going to have this property of model.

It's going to have this property of color. It's going to have this property of doors. is gonna have this method of honk, is gonna have this method of lock. So down here, when I create a new Honda Civic, what I am saying is this special new keyword. We know we see that keyword, we're gonna create an object. We're creating an object using the make car function. We pass in Honda, we pass in Civic, we pass in silver, we pass in four. We know that the object that is created right here is going to have a make, a model, a color, a doors, and a hunk and a lock method right so it's gonna have three sorry four properties and two methods all righty now we can do it again when we want to create a new car we see the new keyword object no we're going to make another object we're using the make car function again however passing in different values, so we're able to reuse this constructor over and over and over again, making their code way drier than it normally has been when we were doing it a few seconds ago, and we can create as many cars as we want. Beautiful. We also had this idea of a prototype, and a prototype is just a fallback source of properties and methods. The objects that come out of our make car constructor can always check themselves for a property and value. And if the object does not have that property or value, it can go up its prototype chain. It can ask where it came from. Hey, make car constructor. Do you have this value?

And if it doesn't have that value, you can keep going up the prototype chain until it hits the what? What's the stop of the prototype chain? Grandma, it is grandma. The global object prototype. Everything inherits from this global object prototype. A lot of times when we've been using methods or properties that the objects that we were using didn't have, it's because they were going up the prototype chain to get them. So the example we gave last class is, let's say I didn't have a car. I could go ask my mom if she had a car. And if she doesn't have a car, she could go ask grandma if she had a car. And if grandma has a car, I have a car. It's the same thing with properties and methods the object checks itself. Hey, do I have Bluetooth and Right now the Tesla Roadster would not have Bluetooth when we created that object. It did not have Bluetooth But what we could do is on that constructors prototype add add Bluetooth. So when the Tesla checks itself, it will not see Bluetooth, but it will go up to the constructor prototype. And since the constructor prototype now has Bluetooth, guess what?

The object that was created from that constructor now has Bluetooth. So we can just think about it as a fallback source of properties and methods. Generational wealth, exactly. If the object itself doesn't have a property or method, it goes to where it was created. If where it was created does not have that property or method, it keeps going up the chain until it gets to this global object prototype. And if it has it, it has it. Cool. Beautiful. All right. Right here, we know that Tesla Roadster has a doors property, but if we look at this car factory or this make car constructor, we see that there's a honk method and a lock method. Does this object, does the Tesla Roadster that came out of this constructor, does it have a two string method? No, does the make car constructor have two string? No, so how come this works? How are we able to take the number of doors, which is two, and get string two back? Grandma had it, exactly.

Grandma was holding onto that two string method. Where'd you get the pink fifties from grandma, right? It went all the way up the prototype chain till it got to the global object prototype that global object prototype had the two-string method and so it got passed all the way down and we can use it here even though the Object didn't have it the constructor didn't have it and we went all the way up the prototype chain to get it. Beautiful All right. I want us to open up Tony Hawk Pro skater, please Tony Hawk Pro Skater. Save this. All right, Tony Hawk Pro Skater. We have some JavaScripts. We got an index.html. So I want you to create a Tony Hawk Pro Skater constructor that makes a skating game character with four properties and three methods. All right, Tony Hawk Pro Skater Constructor that makes a skating game character with four properties and three methods. If you've never played Tony Hawk Pro Skater, that's okay. It's a skateboarding game. So think of some things that a skateboarder would need. Think of some properties, think of some methods, but I want you to use a constructor this time.

No, no literal notation, use a constructor. We're gonna put four minutes on the clock here. Four minutes on the clock. Actually, we'll do five minutes. I want you to really type this out I want you to really type this out five minutes on the clock No copying and pasting if you have to go back and forth to the slides you can But go ahead and build me a Tony Hawk pro skater five minutes on the clock We'll review it and then we're moving on to API's folks. We got time We game dev now is exactly so far. We've built Street Fighter. We're building Tony Hawk. Look at us go We've been hanging out with Lena Lux too long. Look at us. We're game devs now You're hanging out there you're missing out All right folks go for it I Could play goldfinger and not get demonetized or not demonetized Content ID blocked on YouTube I would You got this folks Three minutes, 30 seconds. Can we see the constructor slide? Yeah, we can bring that up. There you go. I know nothing about skateboarding, make it up.

Yeah the remake is pretty solid, I've played it for a little while. Yeah, that's pretty dope and play it on PC. It's been nice just for the music alone. Do a kickflip. You don't need commas with constructors when setting properties. No, you do not Cause you're not literally creating an object. It's a function that spits out an object. I like all the drink. I have not played it. I have not had any time for video games recently, which is really sad, but true. I've watched some people play it like just in passing, but it was cool. You never really played any of the souls games though. Two minutes, folks, you got this. Is the CSGO server up? Maybe, maybe.

Best week ever. Maybe it's coming. I have a few surprises up my sleeves. At least you got ads during the work time. I never thought to do that, just play ads during the break time, like the work time. That might be a way to get around it. Cool. H-S-E-E-H-X. Thank you for the posture check. Good one. Get in here. Cool. I had to copy and paste, I'm sorry. I need to be sorry. Sometimes we got it Dog I messed up I changed it live though Hey It's tough Atlantic How do we see properties we add with the prototype in our constructor?

You won't see it in the initial constructor that you make, but if you open it up in the Inspector, you'll probably be able to see it. I can try, nice. Lazy, we're not there yet. We'll get there. All right, folks, come on back. Let's go over this together. All righty. So, let me go ahead and open this up. Create a Tony Hawk pro skater constructor that makes a skating game character with four properties and three methods. So, I'm gonna create a function, TonyHawkCharacter. There we go. All right. Tony Hawk character. And why did I capitalize the T. Why did I capitalize the T.

Engagement now. Because the constructor. Does the capitalization actually do anything? Nah, it just lets us know that it is a constructor. All right, so what are some properties that I should have? What are some properties that I should have? It's just a convention, exactly. All right, this.characterName equals, and we'll just say name, and then, well not name, Let's go ahead and do, go ahead and say character name. I just want it to be a little bit different for each one so people can see. Cool. Next, we have something else. We have stance, that's a good one. And we'll just call this character stance. Cool. This dot, what else?

It's a, uh, sponsor. That's a good one. We have sponsor equals and we'll say character sponsor. Well, and one more let's say signature move. I like that special move. We'll say special move and we'll say a character move. Cool. Now, this cha-name, cha-stance, cha-sponsor, cha-move, these all have to be what? What do these all have to be? What do these all have to be? They have to be parameters, because there'll be things that are gonna be passed in. Cha-name, cha-stance, cha-sponsor, and cha-move. Cha-money. All right, so we got our properties. What about our methods?

What should our methods be? Like what should our character be able to do? Be able to, okay, I like flip. I see taunt and grab. So we can do flip, taunt, and grab. So flip equals a function, and we'll just say, just make it easy on ourselves, console.log. What's a good flip trick? I'm gonna say kickflip for now. Kickflip. Boop boop. So our character can only kickflip. That's the only flip trick it knows. All right. Next, this dot, we said taunt, and we can do a function and we can actually mention our special move. And we can say like console.log, and we can just use our ticks.

Don't make me use my, and then inside of where we put our variable, we can say this dot special move, right? So you can make it say don't make me use my and then they could say their special move and Then I think the last one we said was grab This dot grab and let's just hard code another grab trick. What's it? What's a good grab trick? Sailfish melon grab Method Yeah, y'all know, y'all play some Tony Hawk. I'm gonna say Melon, Melon Grove. All right, cool. So now we can go ahead and create a character. Let's go ahead and create the best character in the game. We'll say Kareem Campbell. And then we're gonna need the new keyword. Why do I need the new keyword? Darth Maul, why do we need the new keyword? To make a new one, exactly, to make a new object. We want the object that's the character that's gonna help us.

We're gonna call our constructor function, Tony Hawk character. We're gonna pass in their name, which is Kareem. We are going to pass in their stance, which is Goofy. We're going to pass in their sponsor, which is Element. And we're gonna pass in their special move, which is the Ghetto Bird, for folks that have actually played the game. Hey, cool. All right, so let's go ahead and save this. And then let's open this in the browser. And if we open, oh, that's such a, so much nostalgia in that photo. Let's use our inspector. Let's go to the console and let's ask for Kareem Campbell. And we can see when we get Kareem Campbell, we get back a Tony Hawk character that has a name, a flip, a grab, a special move, a sponsor, a stance, and a taunt. So it looks like our constructor worked. First training. Alrighty.

Thought this was ice skating. Alrighty. We got a little bit of time left. Let's let's let's jump into the future folks. We have a new syntax that we'll get into on Tuesday. On Tuesday, we're gonna look at with the newer versions of JavaScript, we got some syntactical sugar, right? Nothing underneath the hood changed. We still have prototypal inheritance, but when folks came from other class-based languages, they felt a little uncomfortable understanding what prototypal inheritance was doing and it didn't look similar to other languages. So with the newer versions of JavaScript, we got the class syntax. Nothing changes under the hood. It just makes it look a little sweeter. And so you can see that it changes up a little bit. We have like this constructor on its own. The methods are kind of on their own now. And so when we come on Tuesday, we'll start using classes a little bit more effectively, but understand as you're doing the reading, there's nothing that really changed under the hood.

It's just syntactical sugar. Nothing really changed. It just looks a little bit better. Cool. Now, APIs. I love me some APIs. I used APIs for probably years before I actually ever understood what the heck an API meant. API bottom jeans. So what the heck are APIs? APIs are something very, very simple. They are a simple interface to do something complex. That's it. An API is a simple interface that enables us to do something complex. So what the heck do I mean by simple interface? All right.

Right now, you are all watching on a crispy 4K camera that's getting downscaled to 1080p, but I still look good. It's the best week ever, right? If I wanted to turn this camera off, what is the most primal thing I could do? What's the most primal thing I could do to turn this camera off? Some people are like, smash it. I could smash it. I could throw it on the table and smash it. That's not something I want to do. Something else probably I could do is I could just rip the power cable out because I'm not running on battery. I'm running on actual power. I could rip the power cable out and the camera would shut off. Now, does Sony want me smashing the camera or ripping out the power cable every single time I want to unplug it? No, Sony does not want me doing that. Maybe they actually do. Maybe they do want me to do that so that I buy more of them, right?

But no, they don't want me to ripping out power cables. They don't want me smashing cameras. they've given me an interface that enables me to turn on and off the camera. What's the interface that Sony has given me to turn on and off the camera? It's a button. It's a power button. And so Sony has given me a very simple interface to do something very complex. Think about everything that has to happen in when I press the power button, right? Like the, the, the, the, their software running on the camera that here's that button turns off the power system makes the capacitors turn off. All these wild things have to happen when I press that power button. And it's the same thing when I turn it on, when I press that power button, all these wild stuff has to happen for that camera to turn on. do I really care at the end of the day what's happening inside that camera when I press the power button? No, I just want it to turn on and I want it to turn off. So Sony has given me a simple interface for some complex action. In this case, the complex action is the turning on and off and the interface is a button.

Another example of this is like when you go to a restaurant. The restaurant gives you a very simple interface to get food. What's the interface that the restaurant gives us to get food? Yeah, it's a menu. It gives, they give us a menu. And that menu is a very simple interface where we can point to something and get that food. Now, if I look at that menu and I want my noodle soup, I don't really know what's happening when I make that request. I don't know what's happening in the kitchen. I have my interface, which is my menu. I asked for my noodle soup and something happens and I get noodle soup back. But I don't know what's happening in that kitchen. The chefs are chopping onions. They are getting bean sprouts together. They're getting noodles together. They're getting broth together.

They're compiling all these things to make my noodle soup. And I actually don't know, and I really don't care how they chop the onions, how they put the bean sprouts into the pot. I don't really care how they do all that stuff. of all I want is my noodle soup. So at a restaurant, I have a simple interface that enables me to make a request and I get that soup. I have no idea what's happening in that kitchen. APIs are the same thing. They are a simple interface for some complex action. However, the interface we're going to use first is a URL. There's a regular URLs like we have here for the slides that we had for the check-in that we had for the merge Everything is just a URL and we're gonna use these URLs to make a request But instead of it being a kitchen that request is going where? Where is that request going it's not going to the kitchen it's going to a server exactly the server is going to hear that request and it's going to send some response so just like our requests that we have of the menu goes to the kitchen and comes back with something we use URLs to make requests to a server and that server sends something back so our simple interface is a URL the complex The next thing that's happening is the server hearing that request, grabbing data, maybe talking to a database to get the data, formatting the data, and then sending it back to us so we can use it. And so that's what happens. When we are utilizing APIs, we are going to make a request to a server using a URL. That server will hear the request, grab everything it needs to grab, and then send a response. This response in the beginning is almost always going to be something called JSON or JavaScript object notation.

It's basically an object that's coming back from the server. So we use a URL, that URL makes a request to the server. Instead of the server sending us soup, it sends us a big old object. We can then use that object, right? We can use that object to get the data and pull the data out, right? So we use the URL to make a request. The server hears that request, builds us a big old object, and then sends that back just like we would get our soup back. And then once we have that object, we can do whatever the heck we want with it. So the very first thing I wanna do is get some cute dog photos. And so here is the syntax to make a request to a URL. So I'm just gonna copy this real quick. We're not gonna get our fingers on the keyboard with this tonight, that'll be Tuesday. But I'm gonna open up my dog photos JavaScript. I'm just gonna paste this in. Let's go ahead and save this.

And let's make sure that it works. Let's go ahead and open this in the browser. Boom, open this in the browser. Let's open up the inspector. Let's go to the console. All right, and we can see something really interesting happened. I made a request and I console logged what came back. Don't worry, I'm gonna break down what's happening here. I console logged what came back. Can we see what came back from the request? Do you see it? You see what came back from the request this big old object came back from the request Okay, so let's let's take a look at it Here is our interface the URL that we are using We use this fetch method to send that request to the server This URL is actually going to the dog CEO server. There is a server out there on the internet at the dog.ceourl that is listening for these fetch requests. And when it hears these fetch requests, it goes and grabs some data from its database, right? It grabs some data from its database and then it responds with that data in the form of an object.

So this first thing right here is saying, hey, whatever we get back from the kitchen, whatever we get back from the server, make sure that it's JSON data. Parse it, look at it as though it was JSON data. And then whatever we get back, we pass through the parameter of data, right? We pass through the parameter of data. So whatever we got back from that DogCEO API is going to now be console logged, right? If there was an error, we would see an error in our console log, but we see right now we're just console logging all the data. So let's go ahead and look at that data we got back. I'm gonna open this up a little bit. We can see that there were two what in the object that we got back. There were two what in the object that we got back. There were two properties, message and status. So the dog CEO API heard our requests and sent us back a message and a status. So the cool thing is we can actually drill in a little bit here. I just want the message property and let's see what happens when I just ask for the message property. So I'm just gonna ask for the message property now and when I refresh, when I refresh, you can see right now I'm just getting the what.

I'm getting a what now. I just asked for the message property and it's a what. What data type is this? The string, it's a string, but that string is a URL. And if we look closely, it's a URL to an image. So we can actually use this. We could use this lovely image URL. We could use it. And so let's go ahead and use it. So if we look in our HTML, we see that we have a lovely image tag. Let's see if we can plop the message that we got from the API into the source. All right, so let's go ahead and try that. We know that the URL or the image URL is in data.message. So we can just do some DOM manipulation here. Document.querySelector.

We're gonna target our image. And what are we gonna change about the image? What are we gonna change? What are we gonna change about the image? which we're going to change the source. And we're going to set the source equal to data.message. Beautiful. So whatever we got back from the API is being passed into data. We want that message property, which was the image URL. And we're going to use that image URL to change the source of the image that's already in our HTML. So if we go back and we refresh, we're just going to get these lovely cute dog photos. I'm just gonna keep refreshing here for a little bit. So every single time I refresh, I am making a request to the server and the server is sending me a new object. And each time that object has a new image URL in it, And I can keep using that image URL. And each time I refresh, I get a nice cute, oh, that we got to end here, a nice cute dog photo that shows up in our, in our lovely, lovely page.

So this is just the very, very beginning of what APIs can do, because there are so many APIs out there. We saw one that returns dog photos, but there are so many APIs that return so many other really cool stuff. We could get Pokemon back from the Pokemon API. We could get drinks from the cocktail database. Once you know just this very simple pattern, right? This very simple pattern, and you find the different URLs that we can use as our interfaces, the whole world opens up. We can start getting cool data back from all these different servers. We can start manipulating it and using it in really cool ways. And so to me, this is where it starts to pay off It starts to be a lot of fun You can start to build some really cool stuff because it's no longer just your data that you're using You can use this data from so many other people and companies that make this stuff available to you. And so On Thursday, we're doing some git and github Sponsored by Microsoft is part of the best week ever, but we're gonna end on Tuesday, spending our day building and playing with APIs, which I'm telling you, it's the next level. It's so much fun, you're gonna really enjoy it. And so remember, tonight was day one. Tomorrow we're going and hanging out with Hello's Rufio. Don't remember, I'll send you a reminder on Discord. Thursday we're back for a sponsored class by Microsoft.

so much swag, so many laptops, so much cool stuff to give out. Friday, we have a wonderful Friday with friends on Discord. Saturday, we're taking over Reddit Place. Sunday, we're back for office hours. Monday, we're doing a portfolio and resume review session, and then Tuesday, we're back at class. You don't have to show up to everything, but we're going to have some fun, so come join us when you can. Hope you all had a wonderful first day of the best week ever. We're going to to do a raid. Let's go over to our good friend, Juicebox Hero. They're live. I wanna keep the good energy going. If you haven't given them a follow, please give them a follow. They're an amazing individual, great streamer. So let's go ahead and set that up. Beautiful.

All right. Set up the raid. Thank you so much for a great class, for a great stream, for the first day of the best week ever. Really excited to spend the rest of the week with you all. So, let's go ahead and create. Issue two.

End of Transcript