<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sourav Sarkar Emon on Medium]]></title>
        <description><![CDATA[Stories by Sourav Sarkar Emon on Medium]]></description>
        <link>https://medium.com/@souravsarkaremon16?source=rss-6dd849fdc442------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mIIoQG_1xKxFpOmD</url>
            <title>Stories by Sourav Sarkar Emon on Medium</title>
            <link>https://medium.com/@souravsarkaremon16?source=rss-6dd849fdc442------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 07:21:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@souravsarkaremon16/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[All About Flutter Architecture: MVP, MVC, MVVM]]></title>
            <link>https://souravsarkaremon16.medium.com/all-about-flutter-architecture-mvp-mvc-mvvm-a5a4db0018f?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5a4db0018f</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Fri, 04 Nov 2022 07:44:51 GMT</pubDate>
            <atom:updated>2022-11-04T07:44:51.733Z</atom:updated>
            <content:encoded><![CDATA[<p>Whenever we create applications like apps, web, or backend it needs two important factors scalability and maintainability.</p><p>And now what are scalability and maintainability? When we add some new features to our projects over a period of time then we can easily add them by scalability. And if we want to change some features in our existing projects we can easily change them by maintainability features. <strong>Good architecture helps us to write good code with scalability and maintainability</strong></p><p>There are different architecture patterns we could implement in our project — <strong>MVC(Model-View-Controller), MVP(Model–view–presenter), and MVVM(Model-View-ViewModel). </strong>These architecture patterns mainly focus on two things — 1. Separation of concerns 2. Unit Testing</p><p><strong>Separation of concerns</strong>: We break our applications into different components like user interface components, business logic components, database components, etc. And if we change one of these components this effect should not affect other components.</p><h3>MVC Architecture Pattern</h3><p>The <strong>Model-View-Controller (MVC)</strong> is an architectural pattern that separates an application into three layers. Model, View, and Controller are the three layers of the application. Each of these components handles specific development parts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*euMAJwbQgUyJ66s1FaZmIg.png" /><figcaption>Image Credit: FlutterDevs</figcaption></figure><p><strong>Model: </strong>Models are the core data flow in this architecture. It can contain business logic also.</p><p><strong>View</strong>: The job of the view is to take input from the user and show the UI to the user.</p><p><strong>Controller:</strong> The controller contains business logic with input data handling.</p><p><strong><em>Some free resources to learn the MVC pattern deeply:</em></strong></p><ol><li><a href="https://www.youtube.com/watch?v=RQf5VVuGJh8&amp;ab_channel=CodeCave">MVC Pattern in Flutter</a> —<strong> By CodeCave(19 minutes Youtube Video)</strong></li><li><a href="https://medium.flutterdevs.com/design-patterns-in-flutter-part-1-c32a3ddb00e2#:~:text=MVC%20In%20Flutter,of%20responsibility%20while%20software%20development.">Design Patterns in Flutter(MVC) by <em>Yashwant Kumar</em></a></li></ol><h3>MVP Architecture Pattern</h3><p>In <strong>Model-View-Presenter (MVP) </strong>pattern <strong>controller </strong>is replaced by the <strong>presenter. </strong>First <strong>The presenter </strong>takes user actions from the view and updates the<strong> model. </strong>Then <strong>The presenter</strong> retrieves updated data from the model and updates the UI in the <strong>view.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvlv-zFL-cnbk9O8pgIgIw.png" /><figcaption>Image Credit: FlutterDevs</figcaption></figure><p><strong><em>Some free resources to learn the MVP pattern deeply:</em></strong></p><ol><li><a href="https://www.youtube.com/watch?v=I2AgSDAEZSE&amp;ab_channel=Codepur">Flutter — MVP Architecture-<strong>Codepur(59 minutes detailed video)</strong></a></li><li><a href="https://medium.com/codechai/the-mvp-architecture-pattern-in-flutter-with-simple-demo-65ab3282c54b">The MVP architecture pattern in flutter with a simple demo by <em>Liem Vo</em></a></li></ol><h3>MVVM Architecture Pattern</h3><p><strong>MVVM </strong>stands for<strong> Model–View–ViewModel. MVVM </strong>is a very famous and established architecture pattern in development. By applying MVVM our code will be reuseable, maintainable, easily testable, and extensible.</p><p><strong>Model: </strong>The model<strong> </strong>can contain some business logic, code validation, and database-related queries. The model interacts with ViewModel.</p><p><strong>ViewModel:</strong> The ViewModel requests data for the model and sends it to the view. ViewModel is the mediator between view and model. First ViewModel deals with user interactions then it requests data from the model and sends it to the view.</p><p><strong>View:</strong> What we see on the device screen is the View. The View is mainly the user interface of an application where a user interacts with widgets. Users interact with some of the events which all are done by the ViewModel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqmXST8gnMXffnQVeYaOXQ.jpeg" /><figcaption>Image Credit: devgenius.io</figcaption></figure><p><strong><em>Some free resources to learn the MVP pattern deeply:</em></strong></p><ol><li><a href="https://www.youtube.com/watch?v=W1e7d3cvnRo&amp;t=442s&amp;ab_channel=MobileProgrammer">MVVM in Flutter using providers —<strong> Mobile Programmer(35 minutes video)</strong></a></li><li><a href="https://medium.com/better-programming/mvvm-in-flutter-edd212fd767a">An introduction to MVVM in Flutter<strong>(With project)</strong> by Mohammad Azam</a></li><li><a href="https://medium.com/flutterworld/flutter-mvvm-architecture-f8bed2521958">Flutter: MVVM Architecture<strong>(Introductory Article)</strong> by <em>Jitesh Mohite</em></a></li></ol><h3>Difference between MVC, MVP, and MVVM</h3><p><strong>MVC:</strong> MVC is one of the oldest models. It is used for small-scale projects. Unit testability is the lowest in this architecture. The Model View Controller architecture tightly couples the view and the model components of the architecture.</p><p><strong>MVP:</strong> MVP is the updated version of the MVC pattern. This software architecture has a dependent user interface as it uses the presenter to act as a link between the view and the model. The components are coupled loosely. Thus we can make changes to it. We can use it for complex projects. It allows appreciable unit testability.</p><p><strong>MVVM:</strong> MVVM is the established architecture pattern that is highly recommended for industry use. MVVM implements data binding and allows easy separation of the model and the view. We can easily make changes to it. MVVM also allows maximum unity testability.</p><p>You can support me here: <a href="https://www.buymeacoffee.com/souravemon16">https://www.buymeacoffee.com/souravemon16</a></p><p>Find me on GitHub: <a href="https://github.com/souemon16">https://github.com/souemon16</a></p><p>Find me on LinkedIn: <a href="https://bd.linkedin.com/in/inventedmyself">https://bd.linkedin.com/in/inventedmyself</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5a4db0018f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a simple todo app with Flutter provider]]></title>
            <link>https://souravsarkaremon16.medium.com/create-a-simple-todo-app-with-flutter-provider-ffabfe4c9d2f?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffabfe4c9d2f</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-provider]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Sun, 27 Feb 2022 05:55:13 GMT</pubDate>
            <atom:updated>2022-02-27T05:55:13.415Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning state management with a real example to-do app is a great choice for it. I will show you how to create a very simple to-do app with Flutter provider. Here we gonna use the Provider package to manage the state of the app.</p><h4>Prerequisites:</h4><p>Flutter installed properly in your system and basic understanding of flutter &amp; dart.</p><h4>Create a blank flutter project:</h4><pre>flutter create todo_app</pre><h4>Add provider package</h4><pre>flutter pub add provider</pre><h4>Create todo model</h4><p>To make your project organized create another folder named <strong><em>model</em></strong> inside <strong><em>lib</em></strong> folder. Create a <strong><em>todo_model.dart</em></strong> file inside that model folder. And this is our model file.</p><p>We will be working on a single model if your project is big and you need more then feel free to create them.</p><p>Here my model looks like that:</p><pre>class TodoModel {</pre><pre>String todoTitle;<br>bool completed;</pre><pre>TodoModel({required this.todoTitle, this.completed = false});</pre><pre><strong><em>// to toggle the task</em></strong><br>void toggleCompleted() {<br>completed = !completed;<br> }<br>}</pre><h4>Create todo model provider</h4><p>In this section, we have to create another class that extends provider package’s specific class <strong><em>changeNotifier</em></strong> This class helps us to change the state of our app and it will notify us to re-render our app.</p><p>In our TodoProvider class, our <strong><em>_task </em></strong>list should be empty or you can put one or two dummy tasks to check the UI. Then we have to create some methods that will help us to modify the tasks in <strong><em>_task </em></strong>list. These methods are <strong><em>get allTasks</em></strong>, <strong><em>addTask</em></strong>, <strong><em>toggleTask</em></strong>, <strong><em>deleteTask</em></strong>. In every method, we must define <strong><em>notifyListeners()</em></strong> at the end to notify all the clients that the object has changed. You can follow my code.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>//import dart:collection for UnmodifiableListView class<br>import &#39;dart:collection&#39;;</pre><pre>import &#39;../model/todo_model.dart&#39;;</pre><pre>class TodoProvider with ChangeNotifier {</pre><pre>//you can put one or two dummy task<br>List&lt;TodoModel&gt; _tasks = [];</pre><pre>//to get all the tasks<br>UnmodifiableListView&lt;TodoModel&gt; get allTasks =&gt; UnmodifiableListView(_tasks);</pre><pre>//all new added task must be uncompleted<br>void addTask(String task) {<br>_tasks.add(TodoModel(todoTitle: task, completed: false));<br>notifyListeners();<br>}</pre><pre>//we are not working with task id that why we are working with every tasks index number to modify</pre><pre>void toggleTask(TodoModel task) {<br>final taskIndex = _tasks.indexOf(task);<br>_tasks[taskIndex].toggleCompleted();<br>notifyListeners();<br>}</pre><pre>void deleteTask(TodoModel task) {<br>_tasks.remove(task);<br>notifyListeners();<br> }<br>}</pre><h4>Complete your main.dart file</h4><p>First, you have to wrap MaterialApp with <strong><em>changeNotifierProvider()</em></strong> class. This <strong><em>changeNotifierProvider</em></strong> is used is exactly like a vanilla provider. Now we have to create a new instance of <strong><em>TodoProvider().</em></strong></p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;<br>import &#39;package:simple_todo_app/providers/todo_provider.dart&#39;;</pre><pre>import &#39;./screens/my_home_page.dart&#39;;<br>import &#39;./providers/todo_provider.dart&#39;;</pre><pre>void main() {<br>runApp(const MyApp());<br>}</pre><pre>class MyApp extends StatelessWidget {<br>const MyApp({Key? key}) : super(key: key);</pre><pre>@override<br>Widget build(BuildContext context) {<br>  return ChangeNotifierProvider(<br>    create: ((context) =&gt; TodoProvider()),<br>    child: MaterialApp(<br>     title: &#39;Simple ToDo App&#39;,<br>     debugShowCheckedModeBanner: false,<br>     theme: ThemeData(<br>      primarySwatch: Colors.deepPurple,<br>     ),<br>     home: const MyHomePage(),<br>    ),<br>   );<br>  }<br> }</pre><h4>Complete your homepage screen</h4><p>Our homepage will be a stateful widget because we gonna use <strong><em>textEditingController()</em></strong> in it. For adding <strong>listener </strong>to our <strong><em>controller </em></strong>we have to create a <strong><em>initState()</em></strong> method. And we must dispose it via <strong><em>dispose() </em></strong>method. We are gonna show a dialog in our <strong><em>floatingActionButton</em></strong>. Users can add new tasks via textField in this dialog. <strong>_textFieldController</strong> will modify this textField behind the scene. Now create a <strong><em>_submit()</em></strong> function to add textField’s text as a task. In this function, tasks will be added by<strong><em> Provider.of()</em></strong> method. And don’t forget to add <strong><em>Navigator.pop()</em></strong> to close the dialog. We should also clear the textField by <strong><em>_textFieldController.clear()</em></strong> method.</p><p>check my code for better understanding.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;</pre><pre>import &#39;../providers/todo_provider.dart&#39;;<br>import &#39;../widgets/todo_action.dart&#39;;</pre><pre>class MyHomePage extends StatefulWidget {<br> const MyHomePage({Key? key}) : super(key: key);</pre><pre> @override<br> _MyHomePageState createState() =&gt; _MyHomePageState();<br>}</pre><pre> class _MyHomePageState extends State&lt;MyHomePage&gt; {<br>  final _textFieldController = TextEditingController();<br>  String newTask = &#39;&#39;;</pre><pre> //creating initState() for adding listener to controller<br> @override<br> void initState() {<br>   super.initState();<br>   _textFieldController.addListener(() {<br>     newTask = _textFieldController.text;<br>   });<br> }</pre><pre> //disposing the controller<br> @override<br> void dispose() {<br>   _textFieldController.dispose();<br>   super.dispose();<br> }</pre><pre> void _submit() {<br>  //we aren&#39;t interested in updating our ui so listen will be false<br>  Provider.of&lt;TodoProvider&gt;(context, listen:    false).addTask(newTask);<br>  //cancelling the dialog<br>  Navigator.pop(context);<br>  _textFieldController.clear();<br> }</pre><pre>@override<br>Widget build(BuildContext context) {<br> Future&lt;void&gt; _showAddTextDialog() async {<br>  return showDialog(<br>   context: context,<br>   builder: (context) {<br>    return AlertDialog(<br>     title: const Text(&quot;Add a new Task&quot;),<br>     content: TextField(<br>      autofocus: true,<br>      controller: _textFieldController,<br>      decoration: const InputDecoration(hintText: &quot;Add New Task&quot;),<br>      onSubmitted: (_) =&gt; _submit(),<br>    ),<br>    actions: [<br>     ElevatedButton(<br>      onPressed: _submit,<br>      child: const Text(&quot;Submit&quot;),<br>      style: ElevatedButton.styleFrom(<br>       minimumSize: const Size(120, 40)),<br>      )<br>     ],<br>     shape: RoundedRectangleBorder(<br>      borderRadius: BorderRadius.circular(16),<br>     ),<br>     actionsAlignment: MainAxisAlignment.center,<br>    );<br>   });<br>  }</pre><pre>return Scaffold(<br> appBar: AppBar(<br>  title: const Text(&quot;ToDo App&quot;),<br> ),<br> body: TodoAction(),<br> floatingActionButton: FloatingActionButton(<br>  onPressed: (() {<br>   _showAddTextDialog();<br>  }),<br> child: const Icon(Icons.add),<br> tooltip: &quot;Add a todo&quot;,<br>   ),<br>  );<br> }<br>}</pre><h4>Complete tasks every action</h4><p>Now it&#39;s time to work with the last and final widget called TodoAction. Here our main goal is to show <strong>all tasks</strong>, <strong>toggle</strong>, and <strong>delete </strong>them. <strong><em>ListView.builder</em></strong> is a great option for all to do. Use <strong><em>ListTile </em></strong>as child widget of <strong><em>itemBuilder</em></strong>. In <strong><em>ListTile </em></strong>there is one checkbox as leading to toggle the task, a title to show the task title, and a trailing to delete the complete task.</p><p>You will get a clear idea after checking my code:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;</pre><pre>import &#39;../providers/todo_provider.dart&#39;;</pre><pre>class TodoAction extends StatelessWidget {<br> const TodoAction({Key? key}) : super(key: key);</pre><pre> @override<br> Widget build(BuildContext context) {</pre><pre> //store the value in a variable<br> final task = Provider.of&lt;TodoProvider&gt;(context);</pre><pre>return ListView.builder(<br>  itemCount: task.allTasks.length,<br>  itemBuilder: ((context, index) =&gt; ListTile(<br>     leading: Checkbox(<br>  // toggle the task as index item    <br>       value: task.allTasks[index].completed,<br>       onChanged: ((_) =&gt; task.toggleTask(task.allTasks[index])),<br>     ),<br>     //show all the task title<br>     title: Text(task.allTasks[index].todoTitle),<br>     trailing: IconButton(<br>       onPressed: () {<br>          //delete task as index item<br>          task.deleteTask(task.allTasks[index]);<br>       },<br>       icon: const Icon(Icons.delete)),<br>    )),<br>  );<br> }<br>}</pre><h4>Wrap up</h4><p>Now your app is ready. Congratulations you successfully created a todo app with flutter provider. If you follow my code along your app will look like this</p><figure><img alt="todo app home page" src="https://cdn-images-1.medium.com/max/1024/1*mOcPYMBwST1ZtG2opYL-Jg.png" /><figcaption>todo app home page</figcaption></figure><figure><img alt="todo app add new task section" src="https://cdn-images-1.medium.com/max/1024/1*478SqIgdROx0RuBkR4xZug.png" /><figcaption>todo app add new task section</figcaption></figure><p>You can find my GitHub code here: <a href="https://github.com/souemon16/simple_todo_app">https://github.com/souemon16/simple_todo_app</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffabfe4c9d2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Common Concepts in React]]></title>
            <link>https://medium.com/swlh/some-common-concepts-in-react-4fe5d886f830?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fe5d886f830</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Fri, 06 Nov 2020 17:47:32 GMT</pubDate>
            <atom:updated>2020-11-08T13:49:36.692Z</atom:updated>
            <content:encoded><![CDATA[<p>React is a open-source javascript library for building awesome user interfaces or UI components. React was first designed by Jordan Walke in 2011. And react was open sourced at js conference in 2013.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fxa6oJFh2lRD7EnAcZIcQg.png" /><figcaption>React js</figcaption></figure><p>In this article I am gonna talk about some common react concept that every beginners should know.</p><h4>1. Components</h4><p>Components is a block of code that can be re-useable and independent. Components make the task of make user interface much easier. There are two type of components, <strong>class components </strong>and <strong>function components.</strong></p><ul><li><strong>class-based components: </strong>class-based component has state, object-oriented programming style, lifecycle methods.</li><li><strong>functional components: </strong>functional component has functional-programming-style and minimal-boilerplate.</li></ul><h4>2. Virtual DOM</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*nN6fPJpA2eKfj9mg-3HBYQ.png" /></figure><p>Another react feature is virtual <strong>document object model</strong>. Behind the scene react creates an in-memory data-structure cache, computes the resulting differences and then updates the browser’s displayed DOM efficiently. This system is called reconciliation. This reconciliation changes entire thing on every programmer change. This method boost the major performance.</p><h4>3. Lifecycle Methods</h4><p>In react every components has a lifecycle which can execution of code during components lifetime. Each lifecycle of components has three main phrases.</p><ul><li><strong>Mounting: </strong>In mounting we have to put elements in DOM. When mounting a component react has 4 method:<strong> <em>constructor()</em></strong><em> </em>, <strong><em>getDerivedStateFromProps()</em></strong> , <strong><em>render()</em></strong> , <strong><em>componentDidMount()</em></strong> .</li><li><strong>Updating: </strong>Updating is the 2nd method of react lifecycle. When a component is updated there is a change in the component’s state or props. It has 5 method: <strong><em>getDerivedStateFromProps(), shouldComponentUpdate(), render(), getSnapshotBeforeUpdate(), componentDidUpdate() .</em></strong></li><li><strong>Unmounting: </strong>The last phrase in the lifecycle is unmounting. It has only one built-in-method: <strong><em>componentWillMount().</em></strong></li></ul><h4>4. JSX</h4><p>JSX stands for JavaScript XML. JSX is used to write HTML code in Javascript. JSX converts HTML into react elements without creating any <strong><em>createElement() </em></strong>method in DOM. Here’s an example:</p><pre>const example = &lt;p&gt;JSX example&lt;p&gt;;<br><br>ReactDOM.render(example, document.getElementById(&#39;root&#39;));</pre><h4>5. Attributes</h4><p>React JSX comes with a lots of attributes. Custom attributes also can add to the components. All these attributes are received in react as a props in components. We can also pass a attribute as a component’s prop and receive it from the component.</p><p>Some of these attributes are: <strong><em>className, id, selected, onChange, formAction, readOnly, value, width, type, title, target, src, span, sizes, required, placeholder, icon, name, min, max, crossOrigin, data, etc.</em></strong></p><h4>6. React Hooks</h4><p>Hooks are new react feature that now we can use state with other feature without writing a class. They make easily understandable. Reacts comes with some built-in hooks. Some common hooks are <strong><em>useEffect, useContext, useReducer, useState, etc.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKOngarWLDAX9Wo75rOfXg.png" /><figcaption>React Hooks</figcaption></figure><p>React hooks has some own rules. This rules must be follow when the hook is used:</p><ol><li>Hook should always called at the top of the component start.</li><li>Hooks should can be called from only react functional components.</li></ol><p>When you build your own hooks they are called custom hooks. One can build custom hook and use these hooks in their code. But they should be aware of code’s integrity.</p><h4>7. React Events</h4><p>React can also performs action based on user events.</p><ul><li><strong>Adding React Events: </strong>React has the same way to use events as HTML. React events are always written in camelCase syntax and event handlers are written inside curly braces.</li><li><strong>React Event Handlers: </strong>React event handlers are declared in the top of components. One event handlers can use in many events.</li><li><strong>Passing Arguements: </strong>We can also send parameter to event handlers.</li></ul><h4>8. Use NPM In React</h4><p>NPM stands for Node Package Manager. Npm is world’s larges software library. Open-source<strong> </strong>developers use npm<strong> </strong>to share<strong> </strong>software. In react we can use npm software to building user interfaces awesome. We can use various package manager from all of them. These package manager make react developer’s life much easier.</p><p>Npm is free for all to use. You can download all npm public software packages without any registration or logon. Just use cmd for installing npm softwares.</p><blockquote>Npm is installed with <strong><em>Node.js</em>. </strong>This means that you have to install Node.js to get npm installed on your computer.</blockquote><h4>9. React CSS</h4><p>React can style with css stylesheet. React css can use <strong>inline styling</strong> or <strong>css stylesheet.</strong></p><ul><li><strong>Inline Styling: </strong>To style an element with inline styling double curly braces is required and the value must be js object.</li><li><strong>CSS stylesheet: </strong>Just create a new file as .css extension. Make your style and import it to your .js component. That’s it, enjoy your styling.</li></ul><h4>10. React Sass</h4><p>Sass is a css pre-processor. Sass is a npm software. By using npm, you can easily install and use Sass in your React projects.</p><p>To use react sass just create a new file as .scss extension. Make your style in this .scss file and import it to your react project. React sass is same as react css but in sass you will get some benefit like declaring variables, creating sass functions, etc. These things will make your code more easier.</p><blockquote>Here are some common react concept that every react beginner should know. In this article I write about very basic concepts of react. I hope this short article has influenced you in a positive way.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fe5d886f830" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/some-common-concepts-in-react-4fe5d886f830">Some Common Concepts in React</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Things You Need To Know For Interview Preparation]]></title>
            <link>https://souravsarkaremon16.medium.com/things-you-need-to-know-for-interview-preparation-8ff7d6cb7a0c?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ff7d6cb7a0c</guid>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-interview]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Thu, 05 Nov 2020 15:40:41 GMT</pubDate>
            <atom:updated>2020-11-05T16:33:21.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W50oLrqtKiqr1bOLqlQZ9g.jpeg" /></figure><p>Our first and last mission as a web developer is to get a job and settle. To get a job as a web developer. To get the job you need to make a impression in interview. Some things if we know about this then we can make a great impression in interview.</p><p>In this article I am gonna talk about some things that gonna make your interview preparation rocks.</p><h3>Common JavaScript Interview Questions</h3><p>Some common tricky javascript things if you know all about this then I am sure you gonna rocks the interview section.</p><h4>Truthy or Falsey Values</h4><p>Two type of value has an inherent boolean value.</p><p>We will get always falsey from these values:</p><ol><li>“ ”, ‘ ’ (empty string)</li><li>false</li><li>null</li><li>undefined</li><li>NaN</li><li>0</li></ol><p>Everything Is Truthy from these values:</p><ol><li>{} (object)</li><li>[] (array)</li><li>function() {}</li><li>‘false’</li></ol><h4>Null vs Undefined</h4><p>Null and Undefined is not the same. They are fully difference one from another. But they have also some similarity.</p><p>You will get always <strong>undefined</strong> from these object:</p><pre>* let name;                //(without define the variable)</pre><pre>* function add(num1, num2) {<br>  num1 + num2<br>}                       // without return the funciton</pre><pre>* function add(num1, num2) {<br>  return num1 + num2;<br>}<br>console.log(add(20));    // If you don&#39;t pass the variable</pre><pre>*const object = {name: &#39;hulk&#39;, color: &#39;green&#39;}  // console.log(object.superpower) if you access an non property </pre><pre>* const some = undefined  // undefined is a reserved word</pre><p>There are two features in <strong>null. </strong>You will get always <strong>null</strong> from:</p><pre>let name = null;     // null must be assigned.<br>console.log(name)    // null is an empty or non-existent value.</pre><h4>Double Equal(==) vs Triple Equal(===)</h4><p>In javascript double equal and triple equal has its own meaning.</p><ol><li><strong>Double Equal(==)</strong></li></ol><p>Double equal is used for type coercion. If we used double equal for checking or comparison something it wouldn’t check for data type. It will only check for only common values.</p><pre>123 == &#39;123&#39;<strong>  </strong>//returns<strong> </strong>true<br>123 ==  123   //returns<strong> </strong>true</pre><p><strong>2. Triple Equal(===)</strong></p><p>Triple equal is used for value with data type coercion. Triple equal will check for common value with its data types.</p><pre>123 === &#39;123&#39;<strong>  </strong>//returns<strong> </strong>false<br>123 ===  123   //returns<strong> </strong>true</pre><h4>Function And Blocked Scope</h4><p>We can declare variables in three way. var, let and const. Before es6 var was the common way to declare variable. But after es6 var a new rule estimated that declare variable with let and const is the best way.</p><pre>//global scope<br>function examp1(){<br>    //function scope <br>    if(){<br>       //blocked scope<br>   }<br>}</pre><p><strong>1. Function Scope</strong></p><p>Var can be re-assigned and updated after assigned. The ‘var’ variable is also function scope. The ‘var’ can be only available inside the function if they once created inside. If they are not created inside then they are called global scope.</p><pre>function setName(){<br>    var name = &#39;spiderman&#39;;<br>    console.log(name);<br>}<br>console.log(name);    //name is not defined</pre><p><strong>2. Blocked Scope</strong></p><p>Let and const are blocked scope. They are only available in curly braces. We can’t access these values from out of the curly braces.</p><pre>function setName(){<br>       var name;</pre><pre>    if(name){<br>      let firstName = &#39;iron&#39;;    //blocked scope<br>      const lastName =  &#39;man&#39;;   //blocked scope<br>}</pre><h3>Some Common JavaScript Coding Problem</h3><p>If you know some simple javascript coding problem then it will make your interview like as easy as pie. Here are some coding problem for you:</p><h4>1. Find the largest element of array</h4><pre>const numbers = [21, 58, 45, 91, 18, 33, 40]<br>let max = numbers[0]<br>for(let i=0; i&lt;numbers.length; i++){<br>  let element = numbers[i];<br>  if(element &gt; max) {<br>   max = element;<br>  }<br>}<br>// get the largest element of array</pre><h4>2. Sum of all numbers in an array</h4><pre>const numbers = [21, 58, 45, 91, 18, 33, 40]<br>let sum = 0<br>for(let i=0; i&lt;numbers.length; i++){<br>  let element = numbers[i];<br>  sum = sum + element;<br>}<br>// get sum of all numbers in an array</pre><h4>3. Remove duplicate item from an array</h4><pre>const roll = [21, 58, 45, 21, 12, 43, 45, 54]<br>let uniqueRoll = [];<br>for(let i=0; i&lt;roll.length; i++;){<br>   let element = roll[i];<br>   let index = uniqueRoll.indexOf(element);<br>   if(index == -1){<br>      uniqueRoll.push(element);<br>     }<br>}<br>//Remove duplicate item from an array</pre><h4>4. Count the number of words in a string</h4><pre>const message = &#39;quick brown fox jumps over the lazy dog&#39;;<br>let count = 0;</pre><pre>for(let i=0; i&lt;message.length; i++;){<br>    let letter = message[i]<br>    if(letter = &quot; &quot;){<br>       count++;<br>    }<br>}<br>// Get number of words in a string</pre><h4>5. Reverse a String</h4><pre>function reverseString(str){<br>   let reverse = &#39;&#39;;<br>   for(let i=0; i&lt;str.length; i++;){<br>       let char = str[i];<br>       reverse = char + reverse;<br>    }<br>   return reverse;<br>}</pre><p><em>Don’t ever think you can’t do something and be the best.</em></p><p><em>If you know these js coding question answer and these coding problem then all js interview will be as easy as pie for you.I hope this short article has influenced you in a positive way.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ff7d6cb7a0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Things You Need To Know To Be A Best Web Developer]]></title>
            <link>https://souravsarkaremon16.medium.com/some-things-you-need-to-know-to-be-a-best-web-developer-1693344f4e19?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/1693344f4e19</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cross-browser-testing]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Thu, 05 Nov 2020 10:50:21 GMT</pubDate>
            <atom:updated>2020-11-05T10:50:21.687Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*MhTrMj7GXz_D9QOVK7uLZA.jpeg" /><figcaption>Things you need to know to be the best</figcaption></figure><p>There are so many people around the world are web developers, but all of them are best? Who doesn’t want to be best.</p><p>In this article I am going to talk about some things that gonna make your skill more advance. And you will be one step advance to be the best. There are some tricky things in web development that every developer must should know. Like cross browser testing, event loop in javascript, try…catch syntax, etc. If you know how this things are and how this things work then you are one step ahead from the other developers.</p><h3>Event Loop In JavaScript</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*nqbkntl3F45qI369RXBTcQ.png" /><figcaption>event loop in js</figcaption></figure><p>We know javascript is a combination of <strong>synchronous</strong> and <strong>asynchronous</strong> events. <strong>Synchronous </strong>is being one after another other hand <strong>asynchronous </strong>is a thing like callbacks or promises.</p><p>Javascript is a single-threaded programming language. It means there’s only one thread that does all of the work. Events are stack in event queue. When single events are done executing. It goes through the skew of events and executes them until they are empty. In these skew of events some events has callback of another function or some of events has set time out of 3–5minutes. Then what should we do now. We don&#39;t gonna wait for the events to complete in 5minutes. There the event loop comes. While the event loop is not empty pull out the first item from event queue and execute it. This loop continuously work until there isn’t anything left in the event stack.</p><p>So basically event queue is like a to-do list for the thread and event loop is a thread is continuously checking this to-do list and doing those thing until there’s anything left.</p><h3>The “try…catch” syntax</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*aO3m1EHeWpchfb4_h0HRPw.jpeg" /><figcaption>try…catch syntax</figcaption></figure><p>By the “try…catch” syntax we can run a code in try block and if any error occurs then try execution will stop and we can simply catch the error the catch block. If there are no error occurs the catch(err) will be ignored. Here’s a simple example:</p><pre>try{</pre><pre>    //your code</pre><pre>} catch(error) {</pre><pre>    //handle error</pre><pre>}</pre><p>Conditions where “try…catch” syntax work:</p><ol><li>“try…catch” only works for runtime errors</li><li>“try…catch” works synchronously</li></ol><h3>Cross Browser Testing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UlhyGyHg1qKyjOVmzgcLqA.png" /></figure><p>There are thousand of web browser and its version are available in internet. Cross browser testing is the practice of making sure that the web sites and web apps you create work across an acceptable number of web browsers.</p><p>To be the best as a web developer you need to be perfect from all corners. Cross browser testing is one of the corner.</p><h3>Why cross browser issue occurs?</h3><ol><li><strong>Outdated Browser Detection</strong>: It is the most common problem for cross browser issue.</li><li><strong>HTML/CSS Validation: </strong>Validation of HTML and CSS codes can pose major problems for developers during cross browser testing.</li><li><strong>Vendor Specific Functions: </strong>Developers must take note that while creating features/functionalities, they have to use specific code in CSS, depending on which browser they are designing for.</li><li><strong>Layout Compability: </strong>By applying CSS Resets, developers often remove the default design in browsers and apply their own.</li><li><strong>DOCTYPE error: </strong>This usually involves some kind of faulty rendering due to missing a basic line in the code.</li></ol><h3>How to solve these issues</h3><ol><li>Use <strong>Modernizer</strong>, a set of superfast test that compaitable all browsers feature.</li><li>Use code Validating tools for HTML and CSS.</li><li>Use the right prefix for the selected browser. here’s the right prefixes :</li></ol><ul><li>Safari and Chrome <em>(-webkit)</em></li><li>Internet Explorer <em>(-ms)</em></li><li>Mozilla Firefox <em>(-moz)</em></li><li>Opera<em> (-o)</em></li></ul><p>4. Use CSS Flexbox or CSS Grids for the modern browsers.</p><p>5. Start with ‘ <strong>!DOCTYPE HTML </strong>’ in the HTML code.</p><p><em>Don’t ever think you can’t do something and be the best.</em></p><p><em>If any developer knows this tips and tricks then he is one step ahead from the other beginner developers. I hope this short article has influenced you in a positive way.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1693344f4e19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Most Used Methods In JavaScript]]></title>
            <link>https://souravsarkaremon16.medium.com/most-used-methods-in-javascript-7742b6df1844?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/7742b6df1844</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[methods]]></category>
            <category><![CDATA[javascriptexample]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Wed, 04 Nov 2020 17:57:17 GMT</pubDate>
            <atom:updated>2020-11-04T17:57:17.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*4CqWWLnOuHimRvpnqnoKWQ.png" /><figcaption>Javascript Most Popular Programming Language</figcaption></figure><p>Almost every programmer used javascript in their daily life. It was the most popular programming language in 2019. Javascript is used by 67.8% developers.</p><p>Javascript methods are action that can be used with js all data types. There are hundreds of methods available for each data type. In all of these methods I am gonna talk about some of most used methods in Javascript.</p><h3>String</h3><p>Strings methods will help you to work with strings.</p><h3>1. toUpperCase()</h3><p>If you need to upper case the whole string. Just use this method and you will be done. The toUpperCase() method returns the string value with upper case. Here’s an example:</p><pre><strong>const str = &quot;uppercase method&quot;; </strong>      // String<br><strong>const example = str.toUpperCase();</strong>  // result: UPPERCASE METHOD</pre><h3>2. toLowerCase()</h3><p>It is just reverse of toUpperCase() method. The toLowerCase() method returns the string value with lower case.</p><pre>const str = &quot;LOWERCASE METHOD&quot;;       // String<br>const example = str.toLowerCase();  // result: lowercase method</pre><h3>3. split()</h3><p>split() method divides a string into substrings. This method convert a string into a array. We have to separate string using separator. This separator can be comma, spaces, pipe, etc.</p><pre><strong>const str = &#39;quick brown fox jump over the lazy dog&#39;</strong> // String<br><strong>const splits = myString.split()</strong> // return &#39;quick&#39;, &#39;brown&#39;, &#39;fox&#39;, &#39;jump&#39;, &#39;over&#39;, &#39;the&#39;, &#39;lazy&#39;, &#39;dog&#39;.</pre><h3>4. trim()</h3><p>the trim() method remove all whitespace from start and from end. It does not harm to the string.</p><pre>const str = &#39;     Hello world!      &#39;;     // String<br>const example = str.trim();  // result: &#39;Hello world!&#39;;</pre><h3>5. includes()</h3><p>The includes() method check that one word or sentences can be found on the existing string or not. This method returns the result as true or false. If the such thing can be found on the string the method returns true. Otherwise it returns false.</p><pre>const str = &#39;quick brown fox jumps over the lazy dog&#39;;  //String</pre><pre>const exp1 = str.includes(&#39;brown&#39;);   //true<br>const exp2 = str.includes(&#39;red&#39;);     //false<br>const exp3 = str.includes(&#39;fox&#39;);     //true<br>const exp4 = str.includes(&#39;elephant&#39;) //false</pre><h3>6. indexOf()</h3><p>The indexOf() method returns the index of first occurrence of specified text in a string.</p><pre>const str = &#39;quick brown fox jumps over the lazy dog&#39;;  //String</pre><pre>const example = str.indexOf(&#39;lazy&#39;);  // result: 31;<br>const example = str.indexOf(&#39;b&#39;);  // result: 5;</pre><h3>Numbers</h3><p>Numbers can be with or without decimal.</p><h3>1. isNan()</h3><p>The isNan() method determines wether the passed value is number or not. The result will true if returns Nan otherwise returns false.</p><pre>const example = &#39;hello world&#39;; <br>const result1 = example.isNaN();   //true</pre><pre>const example2 = 420; <br>const result2 = example2.isNaN();   //false</pre><h3>2. isFinite()</h3><p>The isFinite() method determines if the passed value is finite or not.</p><pre>Number.isFinite(123)  //true<br>Number.isFinite(1/0)  //false<br>Number.isFinite(50/5) //true<br>Number.isFinite(0/0)  //false</pre><h3>3. parseFloat()</h3><p>The parseFloat() method parses a passed string and returns a floating point number. If the first index is letter it will return NaN.</p><pre>const exmp1 = parseFloat(&quot;420&quot;)       // return 420<br>const exmp2 = parseFloat(&quot;42.15)     // return 42.15<br>const exmp3 = parseFloat(&quot;20 year&quot;)  // return 20<br>const exmp1 = parseFloat(&quot;year 20&quot;)  // NaN</pre><h3>4. parseInt()</h3><p>The parseInt() method parses a passed string and returns a integer of specified base. If the first index is letter it will return NaN.</p><pre>const exmp1 = parseInt(&quot;420&quot;)       // return 420<br>const exmp2 = parseInt(&quot;42.15)     // return 42<br>const exmp3 = parseInt(&quot;20.2 year&quot;)  // return 20<br>const exmp1 = parseInt(&quot;year 20&quot;)  // NaN</pre><h3>Math</h3><p>Math is a built in object in Javascript. Math is not a function object.</p><h3>1. Math.abs()</h3><p>The Math.abs() methods returns the absolute value of an number.</p><pre>const exmp1 = Math.abs(&#39;-10&#39;);     // 10<br>const exmp2 = Math.abs(-42);       // 42<br>const exmp3 = Math.abs(null);      // 0<br>const exmp4 = Math.abs(&#39;&#39;);        // 0</pre><h3>2. Math.ceil()</h3><p>The Math.ceil() methods rounds number up to the largest integar.</p><pre>const exmp1 = Math.ceil(.95)         // 1<br>const exmp2 = Math.ceil(42.00054);   // 42<br>const exmp3 = Math.ceil(-7.004)      // -7</pre><h3>3. Math.floor()</h3><p>The Math.floor() methods returns the nearest downwards integar. If the passed value is integar the value will be the same.</p><pre>const exmp1 = Math.floor(10.95)      // 10<br>const exmp2 = Math.floor(42.0085);   // 42<br>const exmp3 = Math.floor(-7.05)      // -6</pre><h3>4. Math.min()</h3><p>The Math.min() method returns the lowest value number passed into it. If there are no number then it will return NaN.</p><pre>const exmp1 = Math.min(2, 3, 1);       // 1<br>const exmp2 = Math.min(-2, -3, -1);   // -3</pre><h3>5. Math.max()</h3><p>The Math.max() is opposite method of Math.min(). This method returns the biggest value number passed into it.</p><pre>const exmp1 = Math.max(2, 3, 1);       // 3<br>const exmp2 = Math.max(-2, -3, -1);   // -1</pre><h3>6. Math.sqrt()</h3><p>The Math.sqrt() method returns the square root of a number that passed in.</p><pre>const exmp1 = Math.sqrt(9); // 3<br>const exmp2 = Math.sqrt(-1); // NaN<br>const exmp3 = Math.sqrt(16); // 4</pre><h3>Array</h3><p>Arrays are used to store multiple data in a single variable. Array is a global object.</p><h3>1. concat()</h3><p>The method concat() used to add two or more array into one. This method returns a new array.</p><pre>const array1 = [&#39;how&#39;, &#39;are&#39;, &#39;you&#39;];<br>const array2 = [&#39;I&#39;, &#39;am&#39;, &#39;fine&#39;];<br>const exmp1 = array1.concat(array2);  // expected output: Array [&quot;how&quot;, &quot;are&quot;, &quot;you&quot;, &quot;I&quot;, &quot;am&quot;, &quot;fine&quot;]</pre><h3>2. every()</h3><p>The every() method executes once for each element present in the array. It returns a boolean value.</p><pre>const isUnder18 = (currentValue) =&gt; currentValue &lt; 18;</pre><pre>const old= [1, 30, 39, 29, 10, 13];<br>const result = array1.every(isUnder18);  //return false</pre><h3>3. filter()</h3><p>The filter() method create a new array that matched with the passed arguments requirement.</p><pre>const words = [&#39;red&#39;, &#39;blue&#39;, &#39;golden&#39;, &#39;yellow&#39;, &#39;pink&#39;];</pre><pre>const result = words.filter(word =&gt; word.length &gt; 4);  // return [&quot;golden&quot;, &quot;yellow&quot;]</pre><h3>4. find()</h3><p>The find() method returns the value of the first element in an array that passed as an arguments.</p><pre>const array1 = [5, 4, 18, 42, 44];</pre><pre>const result = array1.find(element =&gt; element &gt; 20);  // return 42</pre><h3>5. forEach()</h3><p>The forEach() method executes a provided function once for each array element.</p><pre>const array1 = [&#39;x&#39;, &#39;y&#39;, &#39;z&#39;];</pre><pre>const result = array1.forEach(e =&gt; console.log(e));<br>// output: &quot;x&quot;<br>// output: &quot;y&quot;<br>// output: &quot;z&quot;</pre><h3>6. indexOf()</h3><p>This method returns the first index of specified item after searches the array. It returns -1 if the item is not found. The indexOf method returns the position of the first occurence.</p><pre>const avaengers = [&quot;ironMan&quot;, &quot;Hulk&quot;, &quot;SpiderMan&quot;, &quot;cAmerica&quot;];</pre><pre>const result1 = avengers.indexOf(&#39;aquaman&#39;);  // output: -1<br>const result2 = avengers.indexOf(&#39;Hulk&#39;);  // output: 1</pre><h3>7. join()</h3><p>This method creates and returns a new string by concatenating all of the elements in an array. The elements will be separated by a specified separator. The default separator is comma (,).</p><pre>const messages = [&#39;I&#39;, &#39;Love&#39;, &#39;You&#39;];</pre><pre>const result1 = messages.join();    // output: &quot;I,Love,You&quot;<br>const result1 = messages.join(&quot; &quot;); // output: &quot;I Love You&quot;<br>const result1 = messages.join(&quot;-&quot;);    // output: &quot;I-Love-You&quot;</pre><h3>8. map()</h3><p>The map() method creates a new array with the results of calling a function for every array element.</p><pre>const numbers = [4, 9, 16, 25];</pre><pre>const result = numbers.map(Math.sqrt);  // returns [2, 3, 4, 5]</pre><p>These are some very used methods in JavaScript. These example are based on the es6 features. Who is a beginner programmer must should known all these method to be a Javascript developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7742b6df1844" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 10  Interesting Things In JavaScript]]></title>
            <link>https://souravsarkaremon16.medium.com/top-10-interesting-things-in-javascript-babcca4cf3f1?source=rss-6dd849fdc442------2</link>
            <guid isPermaLink="false">https://medium.com/p/babcca4cf3f1</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[facts]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Sourav Sarkar Emon]]></dc:creator>
            <pubDate>Wed, 19 Aug 2020 07:52:10 GMT</pubDate>
            <atom:updated>2020-08-19T07:53:47.204Z</atom:updated>
            <content:encoded><![CDATA[<h3>10 Interesting Things In JavaScript</h3><p>JavaScript is the world’s most popular programming language. JavaScript was invented by <strong><em>Brendan Eich</em></strong> in <strong>1995</strong> and became an <strong><em>ECMA</em></strong> standard in <strong>1997</strong>. Javascript is most well-known as the scripting language. As of 2012, all of the rn browsers fully support JavaScript.</p><p>To be a programmer you must know about JavaScript(Js). Because it is a core part of the programming. JavaScript is more important when you design a website user interface.</p><p>But there are some interesting facts about JavaScript. Here we’ll talk about some strange things in this language’s fun facts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bxEkHw1xewxOFjmGunb-Cw.png" /></figure><h3>1. Programming Language Of The Web</h3><p><strong>JavaScript (JS)</strong> is a lightweight, interpreted, object-oriented language, <br>and is best known as the scripting language for Web pages. it’s also used in <strong>other environments as well</strong>.<br>JavaScript is a <strong>text-based programming language</strong> used both on the client-side and server-side that allows you to make web pages interactive.</p><h3>2. JavaScript engine</h3><p><strong>JavaScript engine</strong> is a computer program that executes JavaScript (JS) code. Every browser provides a <strong>JS engine</strong> that runs the JavaScript code. This engine was a rudimentary interpreter with no optimizations. Running the JavaScript code with this engine was slow but it worked.</p><figure><img alt="how js engine works" src="https://cdn-images-1.medium.com/max/1000/1*C0YmSY-zjZS69pWlDj62Pw.png" /></figure><p>As you can see from the diagram above, the job of the first JavaScript engine was to take the JavaScript source code and compile it to the binary instructions (<em>machine code</em>) that a CPU can understand</p><h3>3. Start with a Semicolon!</h3><p>In much other time, you have to put a semicolon(;) at the end of a statement. But you can start with a semicolon(;) if you want. But it is not recommended.</p><pre>;var a = 2</pre><h3>4. Sum of String and Numbers</h3><p>If you sum a number with a string you will get this:</p><pre>&#39;500&#39; + 1; //&#39;5001&#39;</pre><p>Pretty strange, right?</p><p>But if you sum a string with a number then there will be no doubt:</p><pre>500 + &#39;1&#39;; //501</pre><h3>5. Equal will not give you the result</h3><p>In javascript to declare a variable we have to use ‘=’ but to check equality of two variables we have to use ‘==’ or ‘===’ for matching data and data types.</p><p>Here is an example:</p><pre>var a = ‘100’; <em>// assigning values to a variable with ‘=’</em><br>var b = 100; <em>// assigning values to a variable with ‘=’</em></pre><pre>a == b; <em>// comparing two variables</em></pre><pre>a === b; <em>// comparing two variables, but this operator also checks datatype and compares two values.</em></pre><h3>6. Immediately-Invoked Function Expression</h3><p>Look at the examples below. The first one works but the second one gives Uncaught SyntaxError: Unexpected token ).</p><pre>// Works fine<br>var foo = function () { <br>    //some stuff<br>}();<br><br>// Syntax error<br>function foo() {<br>    //some stuff <br>}();</pre><h3>7. JavaScript Hijacking</h3><p>There is a <strong>CSRF attack</strong> known as “JavaScript hijacking” in which a tag on an attacker’s site damages a page on the victim’s site that returns private information such as JavaScript or JSON.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*jex709Fwz0XbaCagJkNFGg.jpeg" /></figure><p>JavaScript hijacking allows a hacker to gain access to data through a loophole in which an interactive <a href="https://whatis.techtarget.com/definition/Web-site">Web site</a> on a given <a href="https://whatis.techtarget.com/definition/domain">domain</a> can run JavaScript hosted on a different domain. For example, in a Web-based <a href="https://whatis.techtarget.com/definition/e-mail-electronic-mail-or-email">e-mail</a> application that uses Ajax, an attacker can log in as a legitimate user. All of the contents of the e-mail inbox and address book then become available to the hacker. In addition, the hacker may send bogus e-mail messages in the name of the victim.</p><h3>8. Cool Things To Do With JavaScript</h3><p>Without coding many cool things we can do with javascript. Programming language JavaScript has evolved drastically over the years.</p><p><strong>Let’s have a look at all of the cool things that YOU can do with JavaScript:</strong></p><ol><li>Animate Websites</li><li>Make Phone Apps</li><li>Make Serverless Websites</li><li>Make Games</li><li>Flying Drones</li></ol><p>You can do all of the above things with javascript. If you want to know more about it visit: <a href="https://flauntdigital.com/blog/cool-things-to-do-with-javascript/">https://flauntdigital.com/blog/cool-things-to-do-with-javascript/</a></p><h3>9. Function Can Execute Themselves</h3><pre>(function() { alert(&#39;hello&#39;); })(); //alerts &#39;hello&#39;</pre><p><strong>() </strong>The syntax is simple enough: we can declare a function and immediately call it just as we call other functions, with<strong> ()</strong>.</p><h3><strong>10. Undefined Can Be Defined</strong></h3><pre>var someVar;<br>alert(someVar == undefined); //evaluates true</pre><p>This is normal, but</p><pre>undefined = &quot;I&#39;m not undefined!&quot;;<br>var someVar;<br>alert(someVar == undefined); //evaluates false!</pre><p><strong>Undefined</strong> is not actually a reserved word in JavaScript, even though it has a special meaning and is the only way to determine whether a variable is <strong>undefined.</strong></p><p>These are some Interesting things in JavaScript. Hope you will get something new from this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=babcca4cf3f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>