Skip to main content

Posts

Showing posts with the label javascript loops

Compare two arrays

Tutorial on comparing two arrays Let's talk about comparing two array against each other and returning values that they have in common or values that they don't. A bit of back story -- writing a function that will return common values was pretty easy for me to come up with however, returning unique values gave me some trouble and I spent quite a lot of time researching it. Eventually I found this neat  solution  and honestly I am not completely sure if I would get to it myself since I haven't been working enough with objects or this type of statement. Therefore, I will be going back to basics and I am planning to go through the Statements  section on MDN. The solutions  By using  For In...  statement we can solve both problems and I am still trying to figure out if it's possible to apply  For Loop in the unique values function. Return common values I used here a  For Loop on both vowels and str  arrays (string becomes an arr...

Basic JavaScript concepts

[2/100] I am continuing the review of basic JS concepts and functions with Colt Steele on Udemy.  At the moment I am playing around with WHILE and FOR LOOPS. It is all pretty logical to me and I remember a bunch of it. One thing that I always struggle with however is memorizing the structure of each function and names of methods and properties as well as what they do. I think the problem is that I don't write my own JS code on a general basis but rather tweak snippets and plugins I find. I try to solve weekly code challenges on Code Wars  as a way to actually use some of the knowledge I have and learn something new. It is fun and on more than one occasion frustrating but it still feels like not enough to actually remember what exactly I am doing. Maybe there is inherently a fault in the wiring of my brain or simply I just need to find a way to help myself with the process. I would love to, at some point, go in-depth into MDN web docs  and explore this great resour...