If anyone has any interesting solutions, feel free to make a pull request to the repo in the description. This can be a community thing. Just keep the files neat and make sure it is not something that is already there. Same with any other videos/challenges we do in this series.
@TheBeater06 жыл бұрын
At Lession 2 could you make again Challange 5 ? With some better describe then this one? :P I dont really get that :( And with other solution (i dont get only this challange 5)
@adrianomachado56296 жыл бұрын
Brad, greetings from Brazil! Excelente ideia to keep our skills sharp! And we did it, more than 1k likes! Please, provide more videos like that! best regards
@syedmuhammadwaleed7096 жыл бұрын
sir will U please guide do I really need a degree to get into tech industry although sit I learn a lot from your youtube channel
@DennisAlvey6 жыл бұрын
Any chance you can go through the logic of these? discuss the how and why?
@peterborinski6 жыл бұрын
for(var i = 0; i < arr.length/2; i++){ [arr[i], arr[arr.length - 1 - i]] = [arr[arr.length - 1 - i], arr[i]] } return arr; Is also neat to reverse strings :) I don't know how to do pull requests, but you can mabye add this.
@hassankaafiomar6 жыл бұрын
Thanks Brad You're my hero man Giving all these tutorials without paying it wooow guys support this guy he's a LEGEND
@abdallahrizk87875 жыл бұрын
dude you are the best. I used to be a student in a bachelor of software engineering for 3 years and its waste of time if I only knew you before.
@m4gs.3 жыл бұрын
I did your entire MERN stack course on Udemy and got everything I needed to get a job as a React developer. First job I tried (React Software Engineer) What I was expecting in the application test: React stuff What they asked: "Umm... can you like mess with this string in this specific way you've never seen before just for fun?" I failed. I learned the lesson. I'm taking javascript cardio sessions now. Thank's Brad for saving me again lol.
@StackMentor Жыл бұрын
thanks Brad please you can do more of this
@willc67205 жыл бұрын
Brad - Your stuff is fantastic. You are the TOP, most knowledgeable programmer on the internet - Bar none. I'm finishing up your PHP - Front to Back series right now, going to do your PHP & Stripe API project - bought your MERN stack course on Udemy. I'm your new #1 fan. Of anyone I've ever seen code, you know your shit down to the core. Thanks for your videos man, you rock!!
@harismalik97064 жыл бұрын
at 28:00 when he is using a regular expression ,when we use a capitalized string its title doesnt change to upper case so in order to do that use a str.toLowerCase().replace .
@DivineJesusPrayers6 жыл бұрын
Brad, you are truly a blessing to the learning community in this channel of yours. Your passion to teach and see your students succeed is unprecedented. You give above and beyond what one would normally term as 'free content'. I love this content, the name is just awesome, the tutorial is pure gold! Please release more of such series in future as time permits you. From the deepest recess of my heart, I am most grateful sir.
@prabhjotsingh33295 жыл бұрын
Thanks Brad for the practice sessions. Please keep making videos like these. Reverse the string with Recursion function revStr(str){ if(str.length ===0){ return "" } else{ return str[str.length - 1] + revStr(str.slice(0,str.length - 1)) } } let str = "hello" console.log(revStr(str))
@MrRuchir236 жыл бұрын
JavaScript Cardio ... What a innovative heading ... Thinking of doing cardio for many days but never get motivated , But I really want to do this cardio everyday..... Please continue with this series....
@michaeltruss58334 жыл бұрын
Brad: Thank you for providing young developers with these tutorials. Your method of teaching is very precise and knowledgeable. I have learned so much watching your videos on coding and web development. Again, thank you for all that you do.
@DucaTech6 жыл бұрын
For challenge 3: Reverse Int you can use the ? conditional operator in case the interviewer does not allow you to use the Math class or any other higher level objects. For instance: return parseInt(revString) * (int < 0 ? -1 : 1); For CHALLENGE 6: FizzBuzz, you can use the ! operator instead of the === operator. For example: for (let i = 0; i
@continental_drift6 жыл бұрын
It's always good to see other peoples solutions to problems, if they are different then you learn something. Sometimes looking at other peoples solutions can give you insight into how to make your own solutions better.
@DevBranch3 жыл бұрын
I’m currently in a coding boot camp. We do coding exercises every morning and I suck at them. I’ve been looking everywhere, reading online trying to figure it out. These JavaScript cardio sessions are exactly what I’ve been looking for. Really appreciate this Brad.
@AmarKumar-lv1wu6 жыл бұрын
Hey Brad Thanks for this stuff you are the reason for me to not give up while learning programming because solving problem always make me suck really you are the legend of this industry in my opinion i came long way only because of you i had started watching your content last year of december and at that time i was ZERO and now i feel that i'm ready to land my first job as a MERN STACK DEVELOPER within in one month its not enough if i return you something after getting job but i'll return you something with thanks message for making my career and for becoming my mentor as i call in indian language you are my (GURU) Thank You so much Brad God bless you.
@krittatwizted64396 жыл бұрын
This!! This is what I needed to sharpen the skills I have been learning!
@sida99085 жыл бұрын
I don't get it. Who are those 14 dislikes :-? This guy is one of a kind teacher in my opinion. He's an amazing code with a talent that not everyone has and that is explaining and teaching things the easy way Thank you so much for you amazing videos
@ianchin56346 жыл бұрын
You are the real deal, giving the audience the information they need to succeed
@marlonrettis97136 жыл бұрын
He is so elegant in his explanations. God bless you Brad! ...and thank you!
@maxtirdatov6 жыл бұрын
Here is a solution for isPalindrome() without using a function to reverse the string. It's also about three times faster. function isPalindrome(str) { for (let i = 0; i < (str.length / 2 | 0); i++) { if (str[i] !== str[str.length - i - 1]) return false; } return true; }
@varan226 жыл бұрын
Exactly my thoughts, when I was watching a video.
@JLucRob6 жыл бұрын
Nice solution! Just for anyone wondering, the | operator is a Bitwise OR. When using a Bitwise OR with 0 as the 2nd operand, it will always yield the 1st operand, floored. So, "x | 0", is the same as "Math.floor(x)". I had to look it up ;) You can confirm this @Max Tirdatov ?
6 жыл бұрын
When there is a possibility that x is a very large number, it is better to use Math.trunc(x) function instead of x | 0. For small numbers, it does not matter. Example: Math.trunc(666666666666.6) will correctly return 666666666666, while 666666666666.6 | 0 will return 946735786. Also, for negative numbers, x | 0 acts as Math.ceil(x), that is, it rounds the number up, towards zero. For example: -6.6 | 0 === -6 Math.Floor(-6.6) === -7 Math.Trunc === -6 Math.Ceil === -6 6.6 | 0 === 6 Math.Floor(6.6) === 6 Math.Trunc === 6 Math.Ceil === 7 Hope that clears things up.
6 жыл бұрын
For reversing strings, here is a funny while loop, which totally works: function reverseString(str) { let i = str.length, output = ''; while (i --> 0) { // LOL output += str[i]; } return output; }
@brianlmosley6 жыл бұрын
We do not deserve this! Greatest cod by Chanel out!! Thanks Brad!
@terminator_3633 жыл бұрын
for palindrome guys we can use two pointer approach , let i = 0; let j = str.length - 1; while(i
@herosamako17596 жыл бұрын
Thank you so much. after i learned javascript my pc became very slooow (8 years old) that made me stop for 7 months. now i have a brand new pc and needed this so much. thank u again.
@michaelrooze2782 жыл бұрын
You can also use reduceRight which starts from the right side return str.split('').reduceRight((acc, curr) => acc + curr)
@陈瀚龙6 жыл бұрын
I've studied this well, and I want to say, I'm a teacher, and either you put a shit-ton of thought into this video, or you're just a naturally great teacher. By the way, from now on, I'm calling my office "The Javacrypt".
@davehoffman96226 жыл бұрын
I love the idea of doing challenges. I love following your channel Brad! Keep the good content coming.
@MistaT446 жыл бұрын
I will be applying for jobs next semester (last) and I am very insecure about on-the-spot problem solving. This is insane! thanks traversy
@Welcometomyjourney206 жыл бұрын
Thanks Brad. Honestly, this is the next step to do after learning the fundamentals. Solving as much as u can js algorithms & challenges by yourself is the only way to master js coding.
@simonsmith39773 жыл бұрын
Excellent Workout. Just the sort of thing i need to help with js practice. Keep them coming. Thanks
@陈瀚龙6 жыл бұрын
Bro, I've been praying for you to do this for so long. I've even mentioned it in the comments, and I just now saw that you've done. Badass. Thank you, so much.
@eddiegomez41346 жыл бұрын
Didn't know this what white boarding problems would be like. This are similar to the codewars problems. Thanks for this!
@Hammmmyy6 жыл бұрын
Dude havent watched this yet, but from the title it looks like this is just the beginning of a great practice series! Cant wait to check it out! Love that you are really helping us all learn, and learning by doing is the best way. Thanks again, and I'l leave some love when I get the chance to check out the vid
@JoeWong816 жыл бұрын
Thanks for these sample problems Brad. Even though these were fairly straightforward, they really help us for our interviews as well as our overall skill in general. Keep this series coming please.
@Albert-fe8jx6 жыл бұрын
The interview tech q&a is a great idea. It would be greatly enhanced by demonstrating and incorporating unit tests in these example functions. Working functions are great, but incorporated tests are better. It builds a design mindset. Thank you.
@GomPerDie6 жыл бұрын
Brad, Please continue this series, it's a bless.
@zohra97465 жыл бұрын
GREAT Video! I was scared to do algo's but you've really boiled it down to the boiler plate. THANKS!!
@davidsaso12343 жыл бұрын
Loved it. Learnt a lot and WAS very fun. Let's try harder ones!
@maelstrom573 жыл бұрын
You can also check for a palindrome in one line, although I like your solution better: return Array.from(str).every(char => char === str[str.length - (str.indexOf(char) + 1)])
@krave966 жыл бұрын
You're great! Please continue this playlist. From Russia with love and respect )
@MrDunlop7076 жыл бұрын
You are fantastic teacher, developer and you are truly professional. Please upload more JavaScript Cardio videos!!! Best regards!
@IdreesDargahwala476 жыл бұрын
Stephen Grider, a teacher, has his course on Algorthms and Data Structures on Udemy. Kind of reminds me of his videos looking at the syntax. Nevermind, knowledge is available everywhere. 🤞 Thanks Brad.
@jasperricon32315 жыл бұрын
Brad, how many years have you programmed to know all these different technologies? It’s quite amazing how immense your knowledge base is. Thanks for all the videos, they are extremely helpful and great.
@retiar21116 жыл бұрын
This is a quality video just like all other videos you make brad, however, these can be learned by reading articles. Projects on the other hand are much easier to follow along watching a video. Same goes for smaller tutorials that are under 1h and under 20 mins. I love the channel, i love your teaching method and everything!
@sirius8ly3 жыл бұрын
For reverseInt, I came up with: const reverseInt = (int) => { let newStr = int.toString(); return parseInt(newStr.split('').reverse().join('')) * Math.sign(int); }; reverseInt(-6502);
@jasonwelsh4176 жыл бұрын
I love all of your videos and this series is a very welcome and awesome idea. Thanks for all that you do! I am trying to get a job and your content is helping.
@badmuskaybee51116 жыл бұрын
These is 100% cool. I feel like this is more useful in statit type language like C# Java and Phyton
@agboladeadeniyi87776 жыл бұрын
Brad, I must commend you. you are a wonderful person. your tutorials have really helped me. thank you so much.
@ThatGuyDownInThe4 жыл бұрын
it's crazy, Brad is literally has thousands of apprentices like a master tradesman. This is just the new age version of that old concept.
@okonfriday61902 жыл бұрын
Thanks a lot, Traversy Media, I really appreciate and love it please do more of this for like different subtopics in javascript. much love and good energy to do more
@rconr0076 жыл бұрын
Thank you for providing these kinds of exercises. It's good practice for interviews.
@Shawn156904 жыл бұрын
for number 4 i did: const capitalizeLetters = (str) => str.toLowerCase() .split(' ') .reduce((revStr, char) => revStr + char[0].toUpperCase() + char.slice(1) + ' ', '') console.log(capitalizeLetters('this is a teSt'));
@ketankshukla6 жыл бұрын
You already got more than 1000 likes. Looking forward to this becoming a series!
@subhashgn17753 жыл бұрын
Thank you for the great resource man. Very grateful to you.🙏
@tsigiekumssa79726 жыл бұрын
Thank you Brad! You are the best instructor.
@dean60465 жыл бұрын
Thanks so much Brad! You'll be hitting 1 million soon and are very deserving of it!
@dalecooper39946 жыл бұрын
Brad, you are a wonderful person! Thanks for all your effort!
@snehashischattopadhyay95196 жыл бұрын
The exact thing that we wanted! Thank you so much Brad!
@stuknowlton4774 жыл бұрын
Thank you brad I would love more JavaScript Cardio Sessions!!!
@blackaccel6 жыл бұрын
Nice!!! Just what I was looking for! Some coding cardio!
@joben426 жыл бұрын
Keep up the good work Brad. I’ve been struggling with many of these concepts, and this video really helped with my understanding of them. Really appreciate everything your doing on your channel!
@mostafashawki6 жыл бұрын
Perfect, we really need more video like that, this is very very useful for job interviews. Agree? give a like.
@jdiaz66 жыл бұрын
More likes people!!! This is pretty good stuff... thanks Traversy
@heidik17574 жыл бұрын
Just starting JS but this is helping me to start seeing a pattern in solving algorithms. Same thing different desired outcome. Thanks
@BobbyBundlez4 жыл бұрын
how u doin with your studies? im close to starting to look for jobs. been at this a year and a half almost!
@xaviguasch4 жыл бұрын
Amazing series, please do more Brad. I'd buy an entire course of you explaining interview questions.
@phuongta31455 жыл бұрын
in the challenge 5 you could pass those two maxChar and maxNum to the forEach function. It's not necessary to create another 'for' loop for this
@chamnil86664 жыл бұрын
You are a god among humans.Thank you sir.
@beec36946 жыл бұрын
You've officially reached 1K! I can't wait to see more videos like this. I'm learning JS now so seeing solutions and explanations to these problems are great, not to mention the multiple ways of solving the problems are awesome!
@RockstahRolln6 жыл бұрын
This is Brilliant! Perfect timing! I can get to practice these challenges prior to my interview(s). Many Thanks Brad!! Please do more!
@arockiamkaspar23006 жыл бұрын
Super Brad.Really awesome. Expect a bit more harder questions.
@devsami6 жыл бұрын
Just loved it.. please continue it as a series..
@mohamedabdulnazar55106 жыл бұрын
Essential video.Please make more videos on this topic.
@sayedabdulkarim70865 жыл бұрын
var revInt = (n) => { var num = n.toString().split('').reverse().join(''); return n < 0 ? -1 * parseInt(num) : parseInt(num) }
@andreypm36 жыл бұрын
Hi, Brad. I like your idea very much, but what I've missed in the implementation is the performance measurement. Just for myself I've gathered all the variations of solving one problem in separate methods of one class and then used next code: function performTests() { const rev_str_obj = new reverseString(); for (let func_name of Object.getOwnPropertyNames( reverseString.prototype )) { if (func_name == 'constructor') continue; let i = 0; console.time(func_name); while (i < 100000) { i++; output = rev_str_obj[func_name]('Lorem ipsum dolor sit amet, eirmod deleniti explicari his id, vis te posse constituto. No mel omnium nostrud, te vim possit minimum recusabo,'); } console.timeEnd(func_name); } } performTests();
@Mekan1z3 жыл бұрын
good examples, my suggestion to simplify it to use the chrome debugger and vs code. Because in the debugger we can pause in see exact values how it changes.
@navin_kg6 жыл бұрын
hi , this is what I was looking for , thank you so much for taking my words into consideration . plz do continue a videos series like more advance programs and then data structures
@LonelyJester4 жыл бұрын
that maxCharacter one xD drove me a bit crazy. I kinda had it figured but then I was applying objects on array which held the letter and the amount of reps and it was getting really long so I looked for different ways xD. it took me a bit!!!
@pavels95666 жыл бұрын
I would love to see more examples and solutions. Thank you, Brad.
@zastojn_golaz6 жыл бұрын
This is the best thing ever, hope you do more of this kind of videos!
@MenAtWorkMedia226 жыл бұрын
Thanks, Brad! These videos help greatly!
@nurudeennajeem66052 жыл бұрын
Thanks a lot. Please I need more of this tutorial.
@PurdyRich6 жыл бұрын
Brad this is awesome!! This is a great idea for the channel. Thank you once again.
@lejeet36 жыл бұрын
I really liked this video. I'd say just keep doing the future videos the same way while having the content progressively get more challenging.
@annez85986 жыл бұрын
Excellent! Looking forward to your tutorials about debugging and testing particularly for VueJS programs. Many thanks!
@gw2realm6 жыл бұрын
Great vid! Similar problems to this can be found on Codewars. Really great website couldn't recommend enough.
@petecapecod6 жыл бұрын
Oh man this is like one of THE BEST videos yet. I definitely learned new things and it helped in using the JavaScript that I already know. Great job 😎🙌
@mehdihosseinpour63376 жыл бұрын
Thank you Brad, I'd like that a lot, please keep making that on.
@lucasd.18545 жыл бұрын
Coding Dojo! Just graduated from there!
@M0rg1t0u6 жыл бұрын
Wow what a nice idea! I'm quite proud of my solution for number5: function maxCharacter(str) { var maxChar = ' '; var maxLength = 0; for(var i = 0; i < str.length; i ++){ if(str.split(str.charAt(i)).length > maxLength){ maxLength = str.split(str.charAt(i)).length; maxChar = str.charAt(i); } } return maxChar; }
@payskin6 жыл бұрын
this is awesome!
@M0rg1t0u6 жыл бұрын
ahah thanks
@JLucRob6 жыл бұрын
Clever ahah! For anyone wondering, I believe str.charAt(i) does the same as str[i]. I find it more readable with str[i].
@M0rg1t0u6 жыл бұрын
JLucRob good to know. I thought to be able to do that you'd have to split it before
@dansintean68206 жыл бұрын
Higher Order Video man. Keep it up!!!
@nidhirenil18995 жыл бұрын
Too good..loved the usage of array helper functions
@pjbruce1006 жыл бұрын
Love your videos Brad, you're a very able teacher
@highland57293 жыл бұрын
Challenge 4th is useful for title, headline news when it comes users create their content without aware of capitalize each words.
@ZeDon1404 жыл бұрын
This is an awesome video. Thank you for sharing the great content for JS algorithms
@TechRambles6 жыл бұрын
This video came at the perfect time. I have a lot of interviews coming up. Thanks!
@OGBhyve6 жыл бұрын
Woah! I really love your content and I love the bite-sized things you do. This definitely puts a new spin on that same great idea.
@MrVisheshsingh6 жыл бұрын
Thanks brad! We would love to see more videos of this kind so that we can polish our JS skills
@marinpericradan1223 жыл бұрын
Thanks a lot Brad, these videos really are great, keep up the great work =D
@ninjajs75276 жыл бұрын
I would really like to see more of this sessions. Thanks for all your videos Brad =).
@DivineJesusPrayers6 жыл бұрын
Brad, you are truly a blessing to the learning community in this channel of yours. Your passion to teach and see your students succeed is unprecedented. You give above and beyond what one would normally term as 'free content'. I love this content, the name is just awesome, the tutorial is pure gold! Please release more of such series in future as time permits you. From the deepest recess of my heart, I am most grateful sir.