<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: param-19</title>
    <description>The latest articles on DEV Community by param-19 (@parambhatt).</description>
    <link>https://dev.to/parambhatt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F533416%2F730c018e-06c6-4ec4-b1c0-9cc94379ff84.png</url>
      <title>DEV Community: param-19</title>
      <link>https://dev.to/parambhatt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parambhatt"/>
    <language>en</language>
    <item>
      <title>Coop : An App for Students</title>
      <dc:creator>param-19</dc:creator>
      <pubDate>Thu, 02 Dec 2021 16:39:44 +0000</pubDate>
      <link>https://dev.to/parambhatt/coop-an-app-for-students-14jb</link>
      <guid>https://dev.to/parambhatt/coop-an-app-for-students-14jb</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;COOPS:  &lt;em&gt;Driving Information Distribution&lt;/em&gt;&lt;/strong&gt;
&lt;/h1&gt;




&lt;p&gt;&lt;a href="https://www.bits-pilani.ac.in/hyderabad/index.aspx"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tjkOe0N2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.latestlaws.com/media/2018/09/BITS-PILANI.png" alt="N|Solid" width="259" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 21st century has been all about digitisation, information accessibility and rapid growth. As the internet gradually becomes more accessible, the users have started seeking information online. One of those important channels has been the online forums/communities, be it reddit or Facebook. Issue with these communities has been:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overwhelming amount of information present&lt;/li&gt;
&lt;li&gt;Verifying the authenticity of the information&lt;/li&gt;
&lt;li&gt;Redundancy and the credibility of information&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Solving the problem
&lt;/h3&gt;

&lt;p&gt;COOPS solves this problems by introducing closed community exclusive forums. For instance, information shared by a trusted closed community, say, BITSians would be easier to trust, verify, and discuss since they are part of the institute culture. &lt;/p&gt;

&lt;p&gt;The application is designed to have dedicated categories for necessary threads. Since there is no central authority, the information exchanged is moderated with user upvotes and down-votes and the whole system works on the community feedback.&lt;/p&gt;




&lt;h2&gt;
  
  
  Inside the COOPS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Application Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sign-in&lt;/li&gt;
&lt;li&gt;Automatic user profile generation&lt;/li&gt;
&lt;li&gt;Posts

&lt;ul&gt;
&lt;li&gt;Read&lt;/li&gt;
&lt;li&gt;Comment&lt;/li&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Upvote/Downvote&lt;/li&gt;
&lt;li&gt;A tab to view all the user-made post&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;A place to view all comments made by the user in one place&lt;/li&gt;
&lt;li&gt;Easy to access topic threads&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technological Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Drawer Layout&lt;/li&gt;
&lt;li&gt;Actions button&lt;/li&gt;
&lt;li&gt;Fragments&lt;/li&gt;
&lt;li&gt;Google Sign-in&lt;/li&gt;
&lt;li&gt;No SQL Database&lt;/li&gt;
&lt;li&gt;Hashmaps: as the main data structure&lt;/li&gt;
&lt;li&gt;Intents&lt;/li&gt;
&lt;li&gt;Recycler View&lt;/li&gt;
&lt;li&gt;Classes and Objects&lt;/li&gt;
&lt;li&gt;Tab View&lt;/li&gt;
&lt;li&gt;Search Bar&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  The Architecture
&lt;/h3&gt;

&lt;p&gt;After considering Model-View-Presenter, Model-View-ViewModel and Model-View-Controller (MVC) architectures, we chose to go ahead with MVC due to the advantages it has and the ease of implementation; important ones of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Highly supports separation of concern&lt;/li&gt;
&lt;li&gt;Multiple users can work on the application at the same time&lt;/li&gt;
&lt;li&gt;Easier to update the application&lt;/li&gt;
&lt;li&gt;Easier to debug&lt;/li&gt;
&lt;li&gt;Write reusable code&lt;/li&gt;
&lt;li&gt;Supports test-driven development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Model View Controller is a predictable software design that can be used for development across multiple tech stacks like python, java, javascript etc. and is primarily used for developing web applications and mobile apps.  It is designed such that multiple programmers in a team can work on different aspects of development without being dependent on each other. The main aim here is to separate the presentation layer from the logic and database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w-XIkr7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.guru99.com/images/1/122118_0445_MVCTutorial1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w-XIkr7C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.guru99.com/images/1/122118_0445_MVCTutorial1.png" alt="" width="880" height="624"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Breaking it down:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model: Stores and manages data. It is responsible for handling the domain logic(real-world business rules) and communication with the database and network layers.&lt;/li&gt;
&lt;li&gt;View: It is a User Interface layer providing the visualization of the data stored in the Model.&lt;/li&gt;
&lt;li&gt;Controller: Contains the core logic. It gets informed about the user's behaviour and updates the Model accordingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Choosing The Technology
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Kotlin:&lt;/strong&gt; Both Java and Kotlin can be used for Android Development. We chose Kotlin because of the advantages it has over Java. Kotlin leverages the language design expertise observing Java. It is very easy to learn, and reduces the boilerplate code ( or the extra code that we need to write ), for example, in java. Kotlin has a byte code structure that enhances the performance of the application. In addition, it allows both inline and lambda functions making the execution even faster than the same code in Java. Lastly, It is interoperable with Java, also it is more concise. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Firebase:&lt;/strong&gt; We used the Firebase Firestore (a cloud database) since our application is in the beginning stage and does not have a large userbase that would need a real-time database. Provided by Google, it reduces the need to work with several third-party environments and allows server code; if the need ever comes to that. For an app like COOPS, a NoSQL database is preferred because of the dexterity and flexibility offered by the entire data structure, making Firebase the ideal choice as a database.&lt;/p&gt;




&lt;h3&gt;
  
  
  Views
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/SignInActivity.kt"&gt;1. Sign-in View&lt;/a&gt;&lt;/strong&gt;  As a user opens the application, he/she first sees a splash of the COOPS logo [1]; in the background, the application checks if the user has already signed in. If the user is yet to sign in, he/she is provided with the option to Sign-in with Google. Firebase handles the signing in and storing of the user on our application. Simultaneously, we also add the name and user details to our custom user database for our purposes. Once the sign-in is verified, he is redirected to his home page[2].&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RkO9C4ln--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rj0ltix6ij56ral5oz1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RkO9C4ln--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rj0ltix6ij56ral5oz1k.png" alt="Image description" width="419" height="830"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/HomeAdapter.kt"&gt;2. Home Page:&lt;/a&gt;&lt;/strong&gt; This is the page the user would see post-signing in. The user would be able to see all their posts of all the topics he/she has subscribed to. The user can see the topic a particular post belongs to and can click on it to navigate to the more detailed Post View.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9ElaO2qm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luurnmi4f4znuv8y5veo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9ElaO2qm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luurnmi4f4znuv8y5veo.png" alt="Image description" width="411" height="833"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/tree/master/app/src/main/res/layout"&gt;3. General Layout:&lt;/a&gt;&lt;/strong&gt; Every activity in COOPS has an additional side panel and a topbar. The top bar is a search bar, that can be used for searching through the topics that have been created so far. The side panel is used for navigating through the application and moving through the various activities. As of now, the side panel has the user information (name, email and profile picture), the home page, the user profile page and the facility to navigate through to any of his followed topics within the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/SearchActivity.kt"&gt;4. Search Bar:&lt;/a&gt;&lt;/strong&gt; The search bar is present across views in the application which can be used to search for topics that are present in the application; whether the user is already following it or wishes to explore a new topic. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LGerU-cy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/160ismhncw7rwn3x48oy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LGerU-cy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/160ismhncw7rwn3x48oy.png" alt="Image description" width="420" height="839"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/tree/master/app/src/main/java/com/example/coop"&gt;5. Side panel:&lt;/a&gt;&lt;/strong&gt; &lt;br&gt;
The Side panel has three main subparts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Profile: This part consists of the user name, email and profile photo. Clicking on this would direct the user to the profile page.&lt;/li&gt;
&lt;li&gt;Home: This is a home tab. The user can navigate back to the home page of the application by clicking the home icon.&lt;/li&gt;
&lt;li&gt;Following (Topics): The Following tab is a scrollable list of all the topics that the user has been following at that point in time. The user can navigate to any of the topics from the tabs and go see all the posts within the respective topic as and when he/she wishes to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PLWJ6s4S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft0tfffa0lhb97spmqu3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PLWJ6s4S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft0tfffa0lhb97spmqu3.png" alt="Image description" width="387" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/UserInfo.kt"&gt;6. Profile Page: &lt;/a&gt;&lt;/strong&gt;The profile page is the page that contains all the information that we as developers have for each individual user. The layout has been segmented into 3 different tabs :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User-info Tab:
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UaI6Zeck--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5i135s4y1w5pdagswex.png" alt="Image description" width="354" height="754"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tab displays the user based information like user name, their email, their profile picture etc. In the future, we also aim to include more information for users and customization options for them. Additionally, this also contains the sign-out functionality from which a user can sign out.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Posts Tab:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CwlFprDu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmh0q3n7wtuhfccgvavt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CwlFprDu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cmh0q3n7wtuhfccgvavt.png" alt="Image description" width="350" height="755"&gt;&lt;/a&gt;&lt;br&gt;
This tab contains the various posts that a user has made, be it whichever topic he has contributed to. He can see the post title, the post body as well as the topic name so that he has complete information about his content, and can navigate to see the entire post properly in the post view from there.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comments Tab:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Er7PBeyK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o60zasqsibt88mfhgjdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Er7PBeyK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o60zasqsibt88mfhgjdl.png" alt="Image description" width="352" height="746"&gt;&lt;/a&gt;&lt;br&gt;
This tab contains all the comments that the user has made across various posts and topics. In effect, this is all the content contributed by the user and he can once more, navigate across the app to the respective post on which he commented on clicking on the comments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/topicViewActivity.kt"&gt;7. Topic View:&lt;/a&gt; *&lt;/em&gt; &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WNk4IsA4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5kgtbx5reissdh1u58y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WNk4IsA4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5kgtbx5reissdh1u58y.png" alt="Image description" width="411" height="823"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The topic view has the heading with the topic name, referring to the respective topic which you are viewing. The user can reach here either by searching for it or going to it from the user side panel. This also shows the number of followers the topic currently has and gives the user option to follow the topic or unfollow it if he is already following it.&lt;/li&gt;
&lt;li&gt;Below the header, the posts within the topics are shown to the user, and he can navigate to the respective posts by clicking on them.&lt;/li&gt;
&lt;li&gt;Finally, there is also a floating action button, that can be used by the user to make a post within the respective topic. If he wishes to make a post under a different topic, he will have to search up the topic, go within it and then click on the make post button there.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/postViewActivity.kt"&gt;8. Post View: &lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JUZZ_yxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/plevbj45mn7pagad1th1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JUZZ_yxV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/plevbj45mn7pagad1th1.png" alt="Image description" width="411" height="842"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post view has the post title as its header and the post body below it. The post body currently allowed is text only, we plan to add media support to the body very soon. The view also has the number of upvotes/downvotes that are given by the other users of the community. The user can also choose to upvote/downvote the post depending on how useful he found the content, and help the community. In addition, he also gets the option to comment his opinion, findings, inferences etc about the post in a text view below, and other users can also read them to gain valuable insights about it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Param-Bhatt/coop/blob/master/app/src/main/java/com/example/coop/makePostActivity.kt"&gt;9. Make a Post: &lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3X1Wt3I5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e25pl5inifxx0tf3p4wh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3X1Wt3I5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e25pl5inifxx0tf3p4wh.png" alt="Image description" width="404" height="835"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Coming to contributing to the community, the users can make posts within respective topics. The process is relatively very simple: All they have to do is enter the topic title, and the topic body ( blanks are not allowed ), and press the floating tick button to post it. Once he makes a post, he is redirected back to the topic view, where he can see that his post has been posted successfully.&lt;/p&gt;




&lt;h3&gt;
  
  
  More on Technological Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Drawer Layout&lt;/strong&gt;&lt;br&gt;
The android drawer layout is an inbuilt layout, that acts as a top-level container for all our layouts to be used. This allows for an interactive drawer type of layout that can be pulled out by the user on some actions. This is what supports our navigation panel inside the application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Actions button&lt;/strong&gt;&lt;br&gt;
In any application, users love playing with buttons. We have added the minimal buttons that they might need for using the application in a smooth hassle freeway, and this includes two main types of buttons ( apart from the general buttons ): A toggle button to pull out the "drawer" containing our navigation panel, and a Floating Action Button to handle events within the views without really adding clunky bits of boxes within the activities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fragments&lt;/strong&gt;&lt;br&gt;
A fragment represents a reusable portion of the application UI. It defines and manages its own layout, has its own lifecycle and can handle all input events on its own. However, it needs to be hosted by activity or another fragment and gets attached to the host activity/fragment hierarchy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Google Sign-in&lt;/strong&gt;&lt;br&gt;
Rather than all applications maintaining their own versions of user databases and the users having to remember all those credentials, it’s just easier these days to facilitate google sign in, allowing google to handle all that hassle and giving a very good user experience to our users. The feature is as simple as it sounds: Let users login into your app using google.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No SQL Database&lt;/strong&gt;&lt;br&gt;
A NoSQL database or Non-SQL database refers to any non-relational database. They can store the data in form of documents, key-value pairs etc, and the main features that distinguish them include: flexible schemas, horizontal scaling, ease of use ( for developers ) and relatively faster query times&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hashmaps: as a main data structure&lt;/strong&gt;&lt;br&gt;
We have mainly used hashmaps for storing our data, as it helps not only in retrieving but also updating and adding data directly back into firebase. Hashmaps are data structures that store data in the form of key-value pairs. They do not guarantee a specified order but are significantly faster than normal databases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Intents&lt;/strong&gt;&lt;br&gt;
Putting it simply, intents are a sort of messaging object that we as developers can use to request an action from another app component. It contains the basic activity that is to be started, along with any additional data information that may be needed by the app component.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Recycler View&lt;/strong&gt;&lt;br&gt;
A recycler view is an android component that is used to display a relatively large amount of data within a small UI component. It enables us to sync the data and UI much more dynamically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Classes and Objects&lt;/strong&gt;&lt;br&gt;
Its always easier to use OOP paradigms whenever possible, especially in bigger projects where the code complexity will increase with the increase in time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tab View&lt;/strong&gt;&lt;br&gt;
The tab layout in androidx library is a component that allows you to have multiple linear layouts with instances for TabLayout.Tab. Tabs in android applications are just like tabs in web browsers, allowing you to view multiple UIs with data within the same layout.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Search Bar&lt;/strong&gt;&lt;br&gt;
The android search widget with a text bar and a search button, that helps us with the search functionality that we have implemented to help users search topics.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kotlin</category>
      <category>android</category>
      <category>firebase</category>
    </item>
    <item>
      <title>Higher Order Functions</title>
      <dc:creator>param-19</dc:creator>
      <pubDate>Mon, 07 Dec 2020 13:23:32 +0000</pubDate>
      <link>https://dev.to/parambhatt/higher-order-functions-pah</link>
      <guid>https://dev.to/parambhatt/higher-order-functions-pah</guid>
      <description>&lt;h4&gt;
  
  
  Abstraction
&lt;/h4&gt;

&lt;p&gt;Abstraction is the process of hiding information from the users. They give us the ability to understand and read code at a higher level, while hiding the details, to give us an overview. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There exists a &lt;strong&gt;filter&lt;/strong&gt; method which builds a new array that contains the results that pass given test.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;SCRIPTS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;living&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → [{name: "Adlam", ...}, ...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Maps
&lt;/h4&gt;

&lt;p&gt;The map method transforms an array by applying a function to all of its elements and building a new array from the returned values. The new array will have the same length as the input array, but its content will have been mapped to a new form by the function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;mapped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;mapped&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;mapped&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;rtlScripts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;SCRIPTS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;direction&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rtl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rtlScripts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → ["Adlam", "Arabic", "Imperial Aramaic", ...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;reduce&lt;/strong&gt; method is another function that takes in the input, and a condition based on which it combines elements. You can easily understand how reduce works based on the given example.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → 10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>teamtanayejs</category>
      <category>eloquentjs</category>
    </item>
    <item>
      <title>Javascript : Arrays and Objects</title>
      <dc:creator>param-19</dc:creator>
      <pubDate>Mon, 07 Dec 2020 12:45:49 +0000</pubDate>
      <link>https://dev.to/parambhatt/javascript-arrays-and-objects-oep</link>
      <guid>https://dev.to/parambhatt/javascript-arrays-and-objects-oep</guid>
      <description>&lt;h3&gt;
  
  
  Arrays
&lt;/h3&gt;

&lt;p&gt;Arrays are a data type that can store a list of sequences of values. It is written as a list of values between square brackets, separated by commas.&lt;br&gt;
All arrays are 0 indexed in javascript, i.e., the first element starts off with index 0 rather than the conventional 1. This is standard across all coding languages, and has been kind of a tradition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="c1"&gt;//You can access each value inside this array as : &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The first element is : &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="c1"&gt;//The first element is 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two main ways to access properties in JavaScript are with a dot and with square brackets. Both value.x and value[x] access a property on value —but not necessarily the same property. The difference is in how x is interpreted.&lt;br&gt;
When using a dot, the word after the dot is the literal name of the property.&lt;br&gt;
When using square brackets, the expression between the brackets is &lt;em&gt;evaluated&lt;/em&gt; to &lt;strong&gt;get&lt;/strong&gt; the property name. Whereas &lt;strong&gt;value.x&lt;/strong&gt; fetches the property of value named “x”, &lt;strong&gt;value[x]&lt;/strong&gt; tries to evaluate the expression x and uses the result, converted to a string, as the property name.&lt;/p&gt;
&lt;h4&gt;
  
  
  Methods
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Properties that contain functions are generally called &lt;em&gt;methods&lt;/em&gt; of the value they belong to, for example, &lt;em&gt;"toUpperCase"&lt;/em&gt; is a method of string.&lt;/li&gt;
&lt;li&gt;We can manipulate the arrays in JS using two main methods : &lt;strong&gt;&lt;em&gt;push&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;pop&lt;/em&gt;&lt;/strong&gt; .
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sequence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//push method adds an element at the end of the array&lt;/span&gt;
&lt;span class="nx"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → [1, 2, 3, 4, 5]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;//pop method removes the last element of the array&lt;/span&gt;
&lt;span class="c1"&gt;// → 5&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → [1, 2, 3, 4]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Objects
&lt;/h3&gt;

&lt;p&gt;Values of the type object are arbitrary collections of properties. We usually define objects using curly braces &lt;code&gt;{}&lt;/code&gt; . We can access the elements of individual properties within an object using the &lt;code&gt;.&lt;/code&gt; operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;day1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;squirrel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;events&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;work&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;touched tree&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pizza&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;running&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;day1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;squirrel&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → false&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;day1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wolf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → undefined&lt;/span&gt;
&lt;span class="nx"&gt;day1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wolf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;day1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wolf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use the &lt;strong&gt;delete&lt;/strong&gt; operator to delete a property of an object. For example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → 1&lt;/span&gt;
&lt;span class="k"&gt;delete&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → undefined&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → 2&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;left&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → false&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;right&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;anObject&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The binary &lt;strong&gt;in&lt;/strong&gt; operator can be used to check if an object has a property with the particular name. To find the keys in an object, you can use &lt;strong&gt;Object.Keys&lt;/strong&gt; .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;z&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}));&lt;/span&gt;
&lt;span class="c1"&gt;// → ["x", "y", "z"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Array loop
&lt;/h4&gt;

&lt;p&gt;The first loop is below is a normal for loop, going over each element one by one. However, the counter here has no purpose other than referencing each element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;JOURNAL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JOURNAL&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="c1"&gt;// Do something with entry&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;JOURNAL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; events.`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second loop also iterates through the entire array, and each element is sequentially taken as entry, and used inside the loop. &lt;br&gt;
Both the loops are used and work well.&lt;/p&gt;
&lt;h4&gt;
  
  
  Some more methods
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Just like &lt;strong&gt;push&lt;/strong&gt; and &lt;strong&gt;pop&lt;/strong&gt; work at the last index of an array, &lt;strong&gt;shift&lt;/strong&gt; and &lt;strong&gt;unshift&lt;/strong&gt; are used to add and remove elements at the start of an array.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;todoList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;remember&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;todoList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getTask&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;todoList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;rememberUrgently&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;todoList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;To search for a specific value, there is an &lt;strong&gt;indexOf&lt;/strong&gt; method. This returns the first index from the start. If you wish to start searching from the last index, you have &lt;strong&gt;lastIndexOf&lt;/strong&gt; .
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → 1&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;lastIndexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → 3&lt;/span&gt;
&lt;span class="c1"&gt;//Both these methods take in an optional second argument,&lt;/span&gt;
&lt;span class="c1"&gt;//that indicates from where to start searching&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;We also have the &lt;strong&gt;slice&lt;/strong&gt; and &lt;strong&gt;concat&lt;/strong&gt; methods to perform slicing and concatenation respectively.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;a&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;c&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;e&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → ["a", "b", "d", "e"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Strings and their methods
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;One of the most useful ones are &lt;strong&gt;slice&lt;/strong&gt; and &lt;strong&gt;indexOf&lt;/strong&gt; .
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;coconuts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → nut&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;coconut&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;u&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;trim&lt;/strong&gt; method removes whitespaces, and other extra symbols from a given string.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hey param &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="c1"&gt;// → Heyparam&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;padStart&lt;/strong&gt; method allows us to pad a given string, taking in the length and the padding character as arguments.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → 006&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;You can use the &lt;strong&gt;split&lt;/strong&gt; and &lt;strong&gt;join&lt;/strong&gt; methods on strings.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sentence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Secretarybirds specialize in stomping&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;words&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sentence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;words&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// → ["Secretarybirds", "specialize", "in", "stomping"]&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;words&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;. &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → Secretarybirds. specialize. in. stomping&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;You can use the &lt;strong&gt;repeat&lt;/strong&gt; method to create multiple copies of a string
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;LA&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → LALALA&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Rest Parameters
&lt;/h4&gt;

&lt;p&gt;Sometimes, we may want to have a function to have any number of arguments. This can be done by adding in 3 dots &lt;code&gt;...&lt;/code&gt; before the last parameter of the function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="kc"&gt;Infinity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="c1"&gt;// → 9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The JSON Object
&lt;/h3&gt;

&lt;p&gt;We often need to store information in objects, or use it for later use. To do this effectively, we &lt;em&gt;serialize&lt;/em&gt; the data. This means that it will be stored in a flat description. One of the most popular ways is to store it in &lt;strong&gt;JSON (JavaScript Object Notation)&lt;/strong&gt; format. This is used not only for JS, but also used across the web to send and store information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;squirrel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;events&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;work&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;touched tree&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pizza&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;running&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>teamtanayejschallenge</category>
      <category>javascript</category>
      <category>eloquentjs</category>
    </item>
    <item>
      <title>Functions in JS</title>
      <dc:creator>param-19</dc:creator>
      <pubDate>Sat, 05 Dec 2020 19:45:13 +0000</pubDate>
      <link>https://dev.to/parambhatt/functions-in-js-3hc8</link>
      <guid>https://dev.to/parambhatt/functions-in-js-3hc8</guid>
      <description>&lt;p&gt;A function definition is a regular binding where the value of the binding is a function.For example,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const square = function(x) {&lt;br&gt;
return x * x;&lt;br&gt;
};&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each function will have both a definition and declaration.

&lt;ul&gt;
&lt;li&gt;Declaration is basically you simply telling JS to make a particular function, and witholding the info on how the function will process your arguments.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;function declare();&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Definition on the other hand, will tell JS exactly what your function will do with the input arguments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;function declare(){&lt;br&gt;
     console.log("Hi, I am Param");&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scope&lt;/strong&gt; : Each variable will have a scope, usually global or local. 

&lt;ul&gt;
&lt;li&gt;Global scope indicates that the variable can be used by any function or block of code in our program. &lt;/li&gt;
&lt;li&gt;Local scope means that the variable is valid only within our code block, for example, inside a function. No code segment outside our function(&lt;em&gt;in the above example&lt;/em&gt;) will be able to access a local variable.&lt;/li&gt;
&lt;li&gt;Note : Nesting of functions is possible, i.e., you can declare functions within functions, code blocks within other code blocks. This means that we can have a lot of local variables and global variable pairs too.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  The arrow notation :
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Quoting from EloquentJS, &lt;em&gt;"There’s a notation for functions, which looks very different from the others. Instead of the function keyword, it uses an arrow (=&amp;gt;) ."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Its syntax goes like : &lt;/p&gt;

&lt;p&gt;&lt;code&gt;const power = (base, exponent) =&amp;gt; {&lt;br&gt;
      let result = 1;&lt;br&gt;
      for (let count = 0; count &amp;lt; exponent; count++) {&lt;br&gt;
         result *= base;&lt;br&gt;
      }&lt;br&gt;
      return result;&lt;br&gt;
      };&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The arrow comes after all the function arguments, and is followed by the normal function body, as in the usual syntax that we have seen above.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Optional arguments
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A function can be given additional arguments, in the sense you can provide 3 arguments to it, when it has only one argument. This is perfectly fine, and JS will ignore you and do your work.&lt;/li&gt;
&lt;li&gt;Also, you can make define a function as &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;const bio = (name, age = 25) =&amp;gt;{ //age is an optional argument&lt;br&gt;
    console.log("Name :" + name + " Age :" + age);&lt;br&gt;
}&lt;br&gt;
//call 1&lt;br&gt;
bio("param");&lt;br&gt;
//call 2&lt;br&gt;
bio("param",19);&lt;br&gt;
//output 1 : Name :param Age : 25&lt;br&gt;
//output 2 : Name :param Age : 19&lt;/code&gt;&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In the above function, both calls are perfectly valid. &lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Recursion&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;As stated above, you can have functions calling other functions, and even itself within the function. This way of calling a function within itself is known as recursion.&lt;/p&gt;

&lt;p&gt;For recursion, the function will have 2 main things : &lt;br&gt;
    * A base condition, on which it will exit the recursive call&lt;br&gt;
    * The call to function itself&lt;br&gt;
    * Optional : Any other logic/programming, if required&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function power(base, exponent) {&lt;br&gt;
if (exponent == 0) {&lt;br&gt;
return 1;&lt;br&gt;
} else {&lt;br&gt;
return base * power(base, exponent - 1);&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
console.log(power(2, 3));&lt;br&gt;
// → 8&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Review
&lt;/h5&gt;

&lt;p&gt;I would love your feedback on this guys, and feel free to revert back to me with any recommendations that you have for me. You can also mail me at &lt;strong&gt;&lt;a href="mailto:padb19122000@gmail.com"&gt;padb19122000@gmail.com&lt;/a&gt;&lt;/strong&gt; .  &lt;/p&gt;

</description>
      <category>teamtanayejschallenge</category>
      <category>javascript</category>
      <category>eloquentjs</category>
    </item>
    <item>
      <title>Javascript : Program structure</title>
      <dc:creator>param-19</dc:creator>
      <pubDate>Sat, 05 Dec 2020 19:22:39 +0000</pubDate>
      <link>https://dev.to/parambhatt/javascript-program-structure-4hcf</link>
      <guid>https://dev.to/parambhatt/javascript-program-structure-4hcf</guid>
      <description>&lt;p&gt;We look forward to going over JS program samples here, and how the entire program is broken down into various parts. In addition, we shall also see how the parts interact with each other, and come together to give output that we desire.&lt;/p&gt;

&lt;h4&gt;
  
  
  Expressions
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Any fragment of code that produces an output/value is called an &lt;em&gt;expression&lt;/em&gt; . For example, these are expressions :
 &lt;code&gt;1;&lt;/code&gt;
  &lt;code&gt;true?5+10:5-10;&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Note : JS doesn't make it compulsory to insert semicolons at the end of every statement like you would need to in C++. Neither can you just skip semi-colons everywhere like you would need in Python. It is required at &lt;em&gt;some places&lt;/em&gt;, and at other places it is optional : It wont matter if you keep its fine, otherwise also its fine. 
####Bindings or Variables&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;All numbers have a predefined value, and are recognised by JS. But what if you want to store some thing like 25? Writing 25 everywhere will be not only too tedious, but also make it hard to write. We can use variables to bind a value, or &lt;em&gt;hold a value with yourself&lt;/em&gt; . For example, here &lt;code&gt;ten&lt;/code&gt; is a variable
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ten&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ten&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;ten&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// . 100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Keywords are special words that have been reserved for a specific purpose in a language. In the above example, the word &lt;strong&gt;&lt;em&gt;let&lt;/em&gt;&lt;/strong&gt; is a keyword. The following are the keywords in JS : &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;break case catch class const continue debugger default&lt;br&gt;
delete do else enum export extends false finally for&lt;br&gt;
function if implements import interface in instanceof let&lt;br&gt;
new package private protected public return static super&lt;br&gt;
switch this throw true try typeof var void while with yield&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For naming any binding or variable, we can use any of the alphanumeric characters, along with the special character '_' . However, no variable name should start off with a number, special character or should resemble a keyword.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All these keywords, along with the variables and functions together make up the environment. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Functions
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A function is a piece of program that is wrapped in a value. It can take in inputs &lt;em&gt;(called arguments)&lt;/em&gt; , process and then return an expected value. It can also have other &lt;em&gt;"side effects"&lt;/em&gt; , such as printing out some value, calling another function, and so on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Each function will have both a definition and declaration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Declaration is basically you simply telling JS to make a particular function, and witholding the info on how the function will process your arguments.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;declare&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Definition on the other hand, will tell JS exactly what your function will do with the input arguments.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;declare&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
     &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hi, I am Param&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scope&lt;/strong&gt; : Each variable will have a scope, usually global or local. 

&lt;ul&gt;
&lt;li&gt;Global scope indicates that the variable can be used by any function or block of code in our program. &lt;/li&gt;
&lt;li&gt;Local scope means that the variable is valid only within our code block, for example, inside a function. No code segment outside our function(&lt;em&gt;in the above example&lt;/em&gt;) will be able to access a local variable.&lt;/li&gt;
&lt;li&gt;Note : Nesting of functions is possible, i.e., you can declare functions within functions, code blocks within other code blocks. This means that we can have a lot of local variables and global variable pairs too.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Conditionals
&lt;/h4&gt;

&lt;p&gt;We cant have straight forward control of our program , always. We may often need to check for something, and our answer will be based on if the condition is met or not. In such cases, you have the following conditionals :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If block :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It checks for a condition, and executes a code block if the condition is met, else it will move on.
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am inside the if block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If-else block :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It checks for a condition, and executes a code block if the condition is met, else it will execute another code block.
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am inside the if block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am inside else block. Condition is not met&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Else-If ladder :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It checks for a condition, and executes a code block if the condition is met, else it will move on, untill a possible condition is met. If none of these are met, there is also an optional default code block that can be executed.
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am inside the if block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition3&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;.&lt;/span&gt;
   &lt;span class="p"&gt;.&lt;/span&gt;
   &lt;span class="p"&gt;.&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;None of the conditions match, hence I am here&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Nested Else-If :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It checks for a condition, and executes a code block if the condition is met, else it will move on, untill a possible condition is met. If none of these are met, there is also an optional default code block that can be executed.&lt;/li&gt;
&lt;li&gt;You can think of this as another representation for the else if ladder.
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am inside the if block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
     &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition3&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;
                    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                       &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;None of the conditions match, hence I am here&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="p"&gt;}&lt;/span&gt;
         &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The switch block :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The switch block is an exclusive block that is used when we want to set some condition based on a given variable only. &lt;/li&gt;
&lt;li&gt;The &lt;em&gt;break&lt;/em&gt; keyword is used to differentiate between the different conditions, else it will cascade down and all the statements after the { statement where the variable matched condition } will execute. &lt;/li&gt;
&lt;li&gt;The default statement will be executed in the event that none of our conditions match.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expression&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;// code block&lt;/span&gt;
    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;// code block&lt;/span&gt;
    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;// code block&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Looping
&lt;/h4&gt;

&lt;p&gt;Often, in our programs, we may want to execute the same repetitive code block until a certain condition is met. It can be a simple addition or expanded to hundreds of lines of code. For such cases, we have loops to deal with in JS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;While loop :
This loop will keep on being executed as long as the condition is not met.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// code block to be executed&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here, JS checks the condition first every single time, and then execute the code block.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do-While loop : 
This is very similar to the while loop, and will keep on repeating until the condition is met. However, it is different from the while loop in the way it is executed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here, JS executes the code block first and then checks the condition. Hence, it will always run for atleast 1 time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// code block to be executed&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For loop : 
Often, you may want to run a loop with a given iterator, which counts the number of times the loop is run. The condition can be anything, including based on your iterator. For these purposes, we have the for loop.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// code block to be executed&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;Statement&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;executed&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;before&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;execution&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="nx"&gt;Statement&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="nx"&gt;defines&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;condition&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;executing&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="nx"&gt;Statement&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;executed&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;every&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;after&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="nx"&gt;block&lt;/span&gt; &lt;span class="nx"&gt;has&lt;/span&gt; &lt;span class="nx"&gt;been&lt;/span&gt; &lt;span class="nx"&gt;executed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Note : You can always suddenly break out of a loop using the &lt;em&gt;break&lt;/em&gt; keyword, just like we saw in the switch block above.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Comments
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Comments are written lines of code by the programmer, that are not shown or compiled by JS. These are used to enhance the readability and understanding of the code.&lt;/li&gt;
&lt;li&gt;Another practice done to improve the readability is to indent the code. Ofcourse, JS will compile it the same whether you indent your code or not, but to enhance the readability of the code, divide it into proper segments, we indent the same.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>teamtanayejschallenge</category>
      <category>javascript</category>
      <category>eloquentjs</category>
    </item>
    <item>
      <title>Introduction to Javascript</title>
      <dc:creator>param-19</dc:creator>
      <pubDate>Sat, 05 Dec 2020 13:50:28 +0000</pubDate>
      <link>https://dev.to/parambhatt/introduction-to-javascript-123p</link>
      <guid>https://dev.to/parambhatt/introduction-to-javascript-123p</guid>
      <description>&lt;p&gt;Recently, I started off on working with Javascript, after studiously trying to ignore it ( because people said a lot, and I get influenced easily ). I took to &lt;code&gt;php&lt;/code&gt; , had decent projects and even managed to intern at a respectable institute using my knowledge. However, as the days passed, I realised something : I would have to learn and work with Javascript, sooner or later.I did do a couple of projects before, but never felt it worth it and always kept on ignoring it. &lt;/p&gt;

&lt;p&gt;So after a year of ignorance, I got motivated enough to start working with it. It takes a great deal of hard work and self discipline to come out of your safe little bubble, and I feel lucky enough to finally come out of it. Thanks to the motivation offered by peers and mentor Mr.Tanay Pratap, I am finally going to switch to JS.&lt;/p&gt;

&lt;p&gt;Starting off, I am reading the &lt;b&gt;Eloquent JS&lt;/b&gt; , and this is the first blog in a long series of blog posts. I am reading through and learning all the things mentioned in the book, and logging each chapter as a blogpost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chapter 1 : Values, Types and Operators
&lt;/h2&gt;

&lt;p&gt;As we are all familiar, all values numbers variables everything is stored in binary form and read and used by the computer, be it the internet , your CPU or the compiler. Hence, binary is all that we will consider our scales in.&lt;/p&gt;

&lt;h4&gt;
  
  
  Numbers
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;JS uses 64 bits to store the numbers, in the signed format, i.e., the MSB (Most significant bit) will be a 0 or 1 and decide the sign of our number, positive or negative.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For large numbers, the scientific notation of &lt;i&gt;e&lt;/i&gt; is used.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;2.99e8 = 2.99 * 10^8&lt;/code&gt;
*JS also allows for &lt;strong&gt;3&lt;/strong&gt; special numbers, namely :&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Infinity&lt;/code&gt; : Positive infinity&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-Infinity&lt;/code&gt; : Negative infinity&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NaN&lt;/code&gt; : It stands for &lt;em&gt;Not a number&lt;/em&gt; . This kind of numbers are obtained when you end up doing something weird, say a &lt;code&gt;0/0&lt;/code&gt; , or &lt;code&gt;Infinity - Infinity&lt;/code&gt; operation.
####Arithmetic operations&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;JS allows for a total of &lt;strong&gt;5&lt;/strong&gt; arithmetic operators : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Addition &lt;code&gt;+&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Subtraction &lt;code&gt;-&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Multiplication &lt;code&gt;*&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Division &lt;code&gt;/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Modulo operator &lt;code&gt;%&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;All these are carried out in the precedence order, for example, multiplication will be carried out before addition. However, if there are two operators of the same order , the operation will be carried out in a left to right fashion.&lt;br&gt;
    * Tip : Since brackets are allowed here, we can escape the entire precedence by just putting brackets as required.&lt;/p&gt;

&lt;h4&gt;
  
  
  Strings
&lt;/h4&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JS uses 16 bits to represent each string, i.e., each string can describe upto a total of 2^16 characters. That is a lot !!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each character is described in its ASCII value, for example, 'A' has an ASCII of 65, 'a' has an ASCII of 97, and so on. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are also some special characters involved, like for the new line we use the &lt;code&gt;\n&lt;/code&gt; character.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JS uses the &lt;code&gt;backslash()&lt;/code&gt; operator to define such special characters, which may have some importance. It also by default folds down if there are two &lt;code&gt;backslash()&lt;/code&gt; in a row, so both &lt;code&gt;\n&lt;/code&gt; and &lt;code&gt;\n&lt;/code&gt; will be treated as the same.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Template literal : &lt;code&gt;${}&lt;/code&gt; is the template literal. You can use this &lt;em&gt;inside a string&lt;/em&gt; and it wont be printed as it is. Rather, its contents will be calculated and then the result will be printed out. If you are familiar with python, this works the exact same as that of a formatted string.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operators
&lt;/h3&gt;

&lt;p&gt;Now time for some operators 😄 . Wont be going into great details, as these are actually self explanatory&lt;/p&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;typeof&lt;/code&gt; : Returns the type of your object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; : Greater than operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; : Less than operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;gt;=&lt;/code&gt;: Greater than equal to operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;=&lt;/code&gt; : Less than equal to operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;==&lt;/code&gt; : Equal to operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;&lt;code&gt;!=&lt;/code&gt; : Not equal &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Note : Both the equal and not equal operators above &lt;em&gt;(last two)&lt;/em&gt; facilitate automatic type conversion in JS. This means that if you compare a string and a number, JS will convert the string to number, compare and then give you the results. If you dont want such type of automatic type conversions , go for the operators below : &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;===&lt;/code&gt; : Equal to operator, compares without type conversion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;!==&lt;/code&gt; : not equal operator, compares without type conversion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;amp;&lt;/code&gt; : Boolean AND operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; : Logical AND operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;|&lt;/code&gt; : Boolean OR operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;||&lt;/code&gt; : Logical OR operator&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;a?b:c&lt;/code&gt; : Conditional operator. It checks for condition a, and returns b if true else returns c.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Review
&lt;/h5&gt;

&lt;p&gt;I would love your feedback on this guys, and feel free to revert back to me with any recommendations that you have for me. You can also mail me at &lt;strong&gt;&lt;a href="mailto:padb19122000@gmail.com"&gt;padb19122000@gmail.com&lt;/a&gt;&lt;/strong&gt; .  &lt;/p&gt;

</description>
      <category>teamtanayejschallenge</category>
      <category>javascript</category>
      <category>eloquentjs</category>
    </item>
  </channel>
</rss>
