DEV Community

Cover image for Learning JavaScript #Day-03
Anas Khan
Anas Khan

Posted on

Learning JavaScript #Day-03

Struggled with inconsistency regarding my JS learning, was running short on some Deadlines, Well let's not get into excuses. After this 4 day gap and with my lost momentum, finally got the pace again and balanced the imbalanced.

Started with the 'LOOPING', and here comes my favourite loop called 'FOR LOOP'. The syntax is all the same, so nothing much to invest time in it.

Then comes the objects: pretty much interesting. It is said that JavaScript always revolves around the objects. To put objects in simpler term- "objects are collections of the variables on which the programmer is going to play with".
Below is an example of how to implement objects in javascript:

Alt Text

Objects also hold functions, you can define them inside the objects and if that function want to access the properties of objects then, JS gives you a Keyword known as THIS keyword.

THIS keyword refers to the object it belongs to. Below is the implementation of the same.

Alt Text

Also learned some string manipulation by using some methods like:

  1. includes()- which checks the given string if it has included your provided parameter or not.

  2. UpperCase() / Lowercase()-- This converts your given string into uppercase or lower case.

Also learned Math function and random() which gives you the random no. between 0 and 1.

There are lots of functions and kinds of stuff to play with and it really improves your blueprint of coding in javascript. So practising on your desired programs will really help you to sharpen your JS skills.
Below is a program which I implemented by using a few concepts that I learned.

Alt Text

so again I am keeping up with the momentum and will focus on being consistent and keeping the blog up to date. It's really dun coding in JS.

Your suggestions and tips are always welcomed :)

Happy Coding!!

Anas Khan

Top comments (1)

Collapse
 
perun01 profile image
Ranjeet Singh

Keep going brother.