Also check out how to find the largest number in an array: kzbin.info/www/bejne/nICphKB5n9uWfLs
@georgemichael94813 жыл бұрын
I guess it's kind of off topic but does anybody know a good site to watch new movies online ?
@titanachilles76273 жыл бұрын
@George Michael Lately I have been using FlixZone. Just search on google for it =)
@markcory2153 жыл бұрын
@Titan Achilles Definitely, I have been using Flixzone for years myself =)
@georgemichael94813 жыл бұрын
@Titan Achilles Thank you, I signed up and it seems like a nice service :D I appreciate it!
@titanachilles76273 жыл бұрын
@George Michael no problem xD
@nageshthotakura87583 жыл бұрын
You are amazing. Thank you for your efforts.
@codewithbubb3 жыл бұрын
Thanks very much, appreciate your support!
@marykhachatryan20494 жыл бұрын
This was actually very useful! Thank you :)
@codewithbubb4 жыл бұрын
Thanks Mary! Glad you found it useful😀
@ТаисияБартенева-щ1з4 жыл бұрын
Thank you for this video!
@codewithbubb4 жыл бұрын
You're welcome - hope you found it useful!
@Corumt4 жыл бұрын
Can you do something on how to get odd and even numbers using arrays
@codewithbubb4 жыл бұрын
Sure, i'll put something together.
@Girlgirls122333 жыл бұрын
i don't understand why - i? and not just[ inStr.length - 1 ]
@kremowydzien5 жыл бұрын
I didn't think by myself about turn to lower case and removing the non-alphanumerical characters. I did it after watching the video. I used this solution: const isPalyndrome = (str) => { str = str.replace(/[^a-z]/gi, "").toLowerCase(); const reverse = str.split("").reverse().join("").toLowerCase(); return str === reverse; }
@codewithbubb5 жыл бұрын
Yep, good practice to lower case everything to make sure it matches. I like the Regex to remove the non-alpha characters (could also use \W to match non-alphanumeric too 😉).
@EduardoOviedoBlanco3 жыл бұрын
I think your first solution was better than the second one
@blurrywaters Жыл бұрын
Could someone explain the inStr[inStr.length - 1 - i] I’m confused on this.
@Stancehall Жыл бұрын
You still need help?
@blurrywaters Жыл бұрын
@@Stancehall if you could explain the statement above yes that’s be very helpful, thanks!
@selchukkarakus61695 жыл бұрын
This code doesn't work with strings containing - (hyphen)or _ (underscore) eg "_eye" or "0_0 (: /-\ :) 0-0" ?
@codewithbubb5 жыл бұрын
Yeah, the \W word boundary won't pick these up and remove them (I would consider hypens to be part of words but not sure about underscores?). You can adjust your regex to suit your requirements / rules of what should be considered part of the palindrome. e.g /[^a-z]/gi will remove anything that's not actually a letter. Hope that helps?
@uaplatformacomua5 жыл бұрын
So hard I got the issue
@velmurugan.personel5 жыл бұрын
Why not use this i++ instead of i+=1 and inStr[inStr.length - 1] instead of this inStr[inStr.length - 1 -i ]
@codewithbubb5 жыл бұрын
Yes, i++ is fine however it's discouraged in a lot of JavaScript style guides (like AirBnB) so ES Lint complains about it. I've just got in to the habit of using that format now!
@velmurugan.personel5 жыл бұрын
@@codewithbubb Thanks your response man keep rocking.......
@codewithbubb5 жыл бұрын
You're welcome! Thanks for your comment also, it's good to question things all the time!