<?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: Margia Sultana</title>
    <description>The latest articles on DEV Community by Margia Sultana (@margiasultana55).</description>
    <link>https://dev.to/margiasultana55</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%2F778260%2F36295e65-ab3d-4695-854e-909821ea5b2f.jpeg</url>
      <title>DEV Community: Margia Sultana</title>
      <link>https://dev.to/margiasultana55</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/margiasultana55"/>
    <language>en</language>
    <item>
      <title>CRUD Operation</title>
      <dc:creator>Margia Sultana</dc:creator>
      <pubDate>Thu, 23 Dec 2021 17:27:08 +0000</pubDate>
      <link>https://dev.to/margiasultana55/crud-operation-4aa9</link>
      <guid>https://dev.to/margiasultana55/crud-operation-4aa9</guid>
      <description>&lt;p&gt;CRUD stands for create, read, update and delete. These are the four basic functions of persistent storage. Organizations that keep track of customer data, accounts, payment information, and other records require data storage hardware and applications that provide persistent storage. This data is typically organized into a database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create:&lt;/strong&gt;&lt;br&gt;
To create resources in a REST environment, we most commonly use the HTTP POST method. POST creates a new resource of the specified resource type. let’s imagine that we are adding a new package to the stored list of packages for this tourism website, and the package objects are stored in a packages resource. If we wanted to create a new item, we would use a POST request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request:
POST http://www.tourism.com/packages/
Body -
{
  "package": {
    "name": “Goa Tour”,
    "price":20,000
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, This creates a new package with a name value of “Goa Tour” and a price value of 20,000BDT.&lt;br&gt;
After Created successfully the server should return a header with a link.For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Response:
Status Code - 201 (CREATED)
Body -
{
  "package": {
    "id": 123,
    "name": “Goa Tour”,
    "price":20,000
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, for this response, we can see that the newly added package was created successfully. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read:&lt;/strong&gt;&lt;br&gt;
We use the GET method to read resources in a REST environment.GET can be used to read an entire list of items. If we call GET on the same information 10 times in a row, you should get the same response on the first call that we get on the last call.&lt;/p&gt;

&lt;p&gt;Update:&lt;br&gt;
For UPDATE we use the PUT  method for the CRUD operation. For example, if the price of the Goa Tour has gone up, We can do this with a PUT request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
PUT http://www.tourism.com/packages/123
Body -
{
  "package": {
    "name": “Goa Tour”,
    "price":21,000
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This request should change this package with id 123 and now still have the name “Goa Tour”, but the price value should now be 21,000, whereas before it was 20,000. The response includes a Status Code of 200 (OK) to signify that the operation was successful. For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Response:
Status Code -200 (OK)
Body -
{
  "package": {
    "name": “Goa Tour”,
    "price":21,000
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For Delete, we use the DELETE method for the CRUD operation. For example, if we want to remove this Goa tour package we know has an id of 123.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request:
DELETE http://www.tourism.com/packages/123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So after this DELETE call would return the original list of dishes with the {"id": 123, "name": “Goa Tour”, "price": 21,000} entry removed. All other dish objects in the package resource should remain unchanged.&lt;/p&gt;

</description>
      <category>crud</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>React JSX</title>
      <dc:creator>Margia Sultana</dc:creator>
      <pubDate>Wed, 22 Dec 2021 17:08:08 +0000</pubDate>
      <link>https://dev.to/margiasultana55/react-jsx-30nl</link>
      <guid>https://dev.to/margiasultana55/react-jsx-30nl</guid>
      <description>&lt;p&gt;JSX is simply a syntax extension of JavaScript.It stands for JavaScript XML.JSX is an HTML-like syntax that we can use with React to make it easier and more intuitive to create React components. It is only purpose is to make it easier to create React components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits of using JSX:&lt;/strong&gt;&lt;br&gt;
It is type-safe, and most of the errors can be found at compilation time. It makes it easier to create templates. It is faster than regular JavaScript because it performs optimization while translating the code to JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSX Expression:&lt;/strong&gt;&lt;br&gt;
JSX supports expression in pure JavaScript syntax. A JSX expression starts with an HTML-like open tag and ends with the corresponding closing tag. JSX tags support the XML self-close syntax so we can optionally leave the closing tag off. JSX expressions evaluate to ReactElements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt;&lt;br&gt;
JSX supports user-defined JavaScript functions. Function usage is similar to expression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attributes:&lt;/strong&gt;&lt;br&gt;
JSX supports HTML like attributes. All HTML tags and their attributes are supported. JSX uses camelcase naming convention for attributes rather than the standard naming convention of HTML such as a class in HTML becomes className in JSX because the class is the reserved keyword in JavaScript. We can also use our own custom attributes in JSX. For custom attributes, we need to use data- prefix.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Component } from 'react';  
class App extends Component{  
   render(){  
     return(  
         &amp;lt;div&amp;gt;  
             &amp;lt;h1&amp;gt;react JSX&amp;lt;/h1&amp;gt;  
             &amp;lt;h2&amp;gt;JSX atributes&amp;lt;/h2&amp;gt;  
             &amp;lt;p demo-Attribute = "demo"&amp;gt;This is custom attribute.&amp;lt;/p&amp;gt;  

         &amp;lt;/div&amp;gt;  
      );  
   }  
}  
export default App; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we have used a custom attribute demo-Attribute as an attribute for the &lt;/p&gt;
&lt;p&gt; tag. In JSX, we can specify attribute values in two ways.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;As String Literals:&lt;br&gt;
We can specify the values of attributes in double quotes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As Expressions:&lt;br&gt;
We can specify the values of attributes as expressions using curly braces {}.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;JSX Comments:&lt;/strong&gt;&lt;br&gt;
JSX allows us to use comments that begin with /* and ends with */ and wrap them in curly braces {} just like in the case of JSX expressions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSX Styling:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React always recommends using inline styles. To set inline styles, you need to use camelCase syntax. React automatically allows appending px after the number value on specific elements.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { Component } from 'react';  
class App extends Component{  
   render(){  
     var myStyle = {  
         fontSize: 80,  
         color: 'black  
      }  
      return (  
         &amp;lt;div&amp;gt;  
            &amp;lt;h1 style = {myStyle}&amp;gt;JSX styling&amp;lt;/h1&amp;gt;  
         &amp;lt;/div&amp;gt;  
      );  
   }  
}  
export default App;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Feature of ES6</title>
      <dc:creator>Margia Sultana</dc:creator>
      <pubDate>Tue, 21 Dec 2021 16:47:56 +0000</pubDate>
      <link>https://dev.to/margiasultana55/feature-of-es6-356</link>
      <guid>https://dev.to/margiasultana55/feature-of-es6-356</guid>
      <description>&lt;p&gt;JavaScript ES6 is also known as ECMAScript 2015 or ECMAScript 6.ECMAScript 2015 or ES2015 is an update to the JavaScript programming language. I provide a brief summary of some features of ES6 to start quickly in ES6.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript var:&lt;/strong&gt; &lt;br&gt;
When we declare a variable using the var keyword the scope of the variable is either global or local. If we declare a variable outside of a function, the scope of the variable is global. When we declare a variable inside a function, the scope of the variable is local. For example:&lt;br&gt;
var variable_name;&lt;br&gt;
Here variable_name is a global variable that is accessible by any function.&lt;/p&gt;

&lt;p&gt;function increase() {&lt;br&gt;
    var variable_name= 10;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;In this example, the variable_name variable is local to the increase() function. It cannot be accessible outside of the function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript let:&lt;/strong&gt; &lt;br&gt;
ES6 provides a new way of declaring a variable by using the let keyword. The let keyword is similar to the var keyword, except that these variables are blocked-scope. This means they are only accessible within a particular block. For example:&lt;br&gt;
let variable_name;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript const:&lt;/strong&gt; &lt;br&gt;
ES6 provides a new way of declaring a constant by using the const keyword. In ES6 const will have block scoping just like the let keyword. The value of a constant cannot change through re-assignment, and it can’t be redeclared. A constant cannot share its name with a function or a variable in the same scope.  For example:&lt;br&gt;
const CONSTANT_NAME = value;               &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Classes:&lt;/strong&gt;&lt;br&gt;
JavaScript class is used to create an object. Keyword class is used to create a class. Class is similar to a constructor function.For example:&lt;br&gt;
class Person {&lt;br&gt;
  constructor(name) {&lt;br&gt;
    this.name = name;&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
 &lt;strong&gt;JavaScript Arrow Function:&lt;/strong&gt; &lt;br&gt;
ES6 arrow functions provide us the way to write a shorter syntax compared to the function expression.For example,&lt;/p&gt;

&lt;p&gt;// function expression&lt;br&gt;
let x = function(x, y) {&lt;br&gt;
   return x * y;&lt;br&gt;
}&lt;br&gt;
// function expression using arrow function&lt;br&gt;
let x = (x, y) =&amp;gt; x * y;&lt;br&gt;
&lt;strong&gt;Default perimeter value:&lt;/strong&gt; &lt;br&gt;
When we do not provide a parameter in a function then it became an undefined value that’s why we specify default parameters to set a default value in the parameters of a function. In the ES6 version, you can pass default values in the function parameters. For example,&lt;br&gt;
function say(message='Hi') {&lt;br&gt;
    console.log(message);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;say(); // 'Hi'&lt;br&gt;
say('Hello') // 'Hello'&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Destructuring:&lt;/strong&gt;&lt;br&gt;
 The destructuring syntax makes it easier to assign values to a new variable. For example,&lt;br&gt;
// before you would do something like this&lt;br&gt;
const person = {&lt;br&gt;
    name: 'Marjia',&lt;br&gt;
    age: 23,&lt;br&gt;
    gender: 'female'&lt;br&gt;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;let name = person.name;&lt;br&gt;
let age = person.age;&lt;br&gt;
let gender = person.gender;&lt;/p&gt;

&lt;p&gt;//now we do something like this&lt;br&gt;
const person = {&lt;br&gt;
    name: 'Marjia',&lt;br&gt;
    age: 23,&lt;br&gt;
    gender: 'female'&lt;br&gt;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;let { name, age, gender } = person;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>CSS Animation</title>
      <dc:creator>Margia Sultana</dc:creator>
      <pubDate>Tue, 21 Dec 2021 14:33:05 +0000</pubDate>
      <link>https://dev.to/margiasultana55/css-animation-5eed</link>
      <guid>https://dev.to/margiasultana55/css-animation-5eed</guid>
      <description>&lt;p&gt;CSS animation is a useful and powerful tool. It makes a website interesting and creatively exciting, In this article, we round up some of the coolest CSS animations. The animation property in CSS can be used to animate many other CSS properties such as color height width. Each animation needs to be defined with the @keyframes.CSS animations are initiated by specifying keyframes for the animation these keyframes contain the styles that the element will have. Now we discuss some CSS animation properties.&lt;/p&gt;

&lt;p&gt;1.@keyframes: It is used to specify the animation.&lt;br&gt;
 Syntax:&lt;br&gt;
@keyframes slidein {&lt;br&gt;
  from {&lt;br&gt;
    transform: translateX(0%);&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;to {&lt;br&gt;
    transform: translateX(100%);&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
2.animation: This is a property, used for setting all the properties, except the animation-play-state and the animation-fill- mode property.&lt;br&gt;
 Syntax:&lt;br&gt;
animation&lt;br&gt;
[ name duration timing-function delay iteration-count direction fill-mode play-state ]&lt;/p&gt;

&lt;p&gt;3.animation-delay: It specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation.&lt;/p&gt;

&lt;p&gt;4.animation-direction: This property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.&lt;/p&gt;

&lt;p&gt;5.animation-duration: It specifies the time duration taken by the animation to complete one cycle.&lt;/p&gt;

&lt;p&gt;6.animation-timing-function: establishes preset acceleration curves such as ease or linear. A keyframe's timing function is applied on a property-by-property basis from the keyframe on which it is specified until the next keyframe specifying that property, or until the end of the animation if there is no subsequent keyframe specifying that property. &lt;/p&gt;

&lt;p&gt;7.animation-iteration-count: the number of times the animation should be performed. This property is specified as one or more comma-separated values.&lt;br&gt;
6.animation-fill-mode: This property sets which values are applied before/after the animation.&lt;br&gt;
animation-play-state: It specifies if the animation is running or paused.&lt;br&gt;
9.animation-name: It specifies the name of @keyframes animation.&lt;/p&gt;

&lt;p&gt;we can comma-separate the values to declare multiple animations on a selector as well. Animating most properties is a performance concern. So, there are certain combinations that can be animated safely:&lt;br&gt;
transform: translate()&lt;br&gt;
transform: scale()&lt;br&gt;
transform: rotate()&lt;br&gt;
opacity&lt;/p&gt;

</description>
      <category>css</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
