<?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: Marina Yamaoto</title>
    <description>The latest articles on DEV Community by Marina Yamaoto (@marina294).</description>
    <link>https://dev.to/marina294</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%2F561286%2F0a18b5b0-6f48-4cc5-b209-65a5c74652f7.jpg</url>
      <title>DEV Community: Marina Yamaoto</title>
      <link>https://dev.to/marina294</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marina294"/>
    <language>en</language>
    <item>
      <title>Learn Node.js for beginners</title>
      <dc:creator>Marina Yamaoto</dc:creator>
      <pubDate>Wed, 09 Jun 2021 00:25:29 +0000</pubDate>
      <link>https://dev.to/marina294/learn-node-js-for-beginners-163g</link>
      <guid>https://dev.to/marina294/learn-node-js-for-beginners-163g</guid>
      <description>&lt;p&gt;Hi there.&lt;br&gt;
This article is for beginners who want to learn basic Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is node.js?
&lt;/h2&gt;

&lt;p&gt;At first, let's talk about what is node.js.&lt;br&gt;
Node.js is an open-source server side runtime environment built on Chrome's V8 JavaScript engine.&lt;br&gt;
It provides an event driven, non-blocking (asynchronous) I/O and cross-platform runtime environment for building highly scalable server-side applications using JavaScript.&lt;br&gt;
It mean, Node.js was created to control server-side processing with JavaScript, and has the feature of being able to handle large amounts of access at high speed.&lt;br&gt;
You can run Node.js not only on the web, but also in various fields such as IoT and smartphone applications.&lt;br&gt;
Recently, Node.js is also being used for front-end (client-side) development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What applications use Node.js?
&lt;/h2&gt;

&lt;p&gt;These are just a few companies that use Node.js. There are many more, for the same or different reasons.&lt;br&gt;
First, Node.js is extremely fast, as exhibited by its reputation in speeding up web pages.&lt;br&gt;
Node.js can also be used for UI development, and many of the companies that use Node.js primarily use it for that reason.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uber
&lt;/h3&gt;

&lt;p&gt;Uber, a cab dispatch service, also uses Node.js for their core system. &lt;/p&gt;

&lt;p&gt;Node.js was chosen because the Uber service is used all over the world and requires a huge network system to operate.&lt;br&gt;
Uber now can process over 2 million remote procedure calls (RPCs) per second.&lt;/p&gt;

&lt;h3&gt;
  
  
  Paypal
&lt;/h3&gt;

&lt;p&gt;Paypal is a payment service that uses email accounts and the Internet.&lt;/p&gt;

&lt;p&gt;By switching from Java to Node.js as the server-side development language, the gap with the front-side development has been reduced.&lt;br&gt;
Senior Director of Payments Products and Engineering at PayPal says, The Node.js app was built almost twice as fast with fewer people, in 33% fewer lines of code and 40% fewer files (in comparison with previous Java-based application).&lt;/p&gt;

&lt;h3&gt;
  
  
  LinkedIn
&lt;/h3&gt;

&lt;p&gt;LinkedIn is the social network for professional connections. It is best suited for people looking to make serious career moves who want to get noticed by relevant companies. &lt;/p&gt;

&lt;p&gt;Previously, Ruby on Rails was used, but in order to increase the speed of access, it was moved to Node.js.&lt;br&gt;
They were able to drastically cut down on server resources and the app is said to run 20 times faster than its predecessor. HTML5 was also a big factor in LinkedIn’s mobile app development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Netflix
&lt;/h3&gt;

&lt;p&gt;Netflix is the world’s biggest global provider of video streaming including movies and television series, available in over 190 countries. As of July 2020, Netflix reported over 192 million subscribers worldwide, with more than 72 million in the U.S itself.&lt;/p&gt;

&lt;p&gt;Previously, Netflix was using Java on the back end and JavaScript on the front end, which required the developers to be proficient with languages.&lt;/p&gt;

&lt;p&gt;Now, The user interface (UI) of Netflix was built using Node.js.&lt;br&gt;
According to the Netflix team, the modularity of the framework encouraged them to use Node.js. Netflix is also almost two times faster during startup as a consequence.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is "npm"
&lt;/h2&gt;

&lt;p&gt;Next, his is an explanation of the Node.js package management tool "npm".&lt;br&gt;
"npm" stands for "Node Package Manager" and is a tool for managing Node.js packages. npm manages the many packages that are available for development in Node.js.&lt;/p&gt;

&lt;p&gt;npm is automatically installed when Node.js is installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  "Global" and "local" installation
&lt;/h3&gt;

&lt;p&gt;There are two ways to install packages with npm "global installation" and "local installation".&lt;br&gt;
Global installation allows you to use the package in all your projects.&lt;br&gt;
Local installation installs the package on a project-by-project basis, so the package can be used only in the installed project.&lt;/p&gt;

&lt;h3&gt;
  
  
  package.json
&lt;/h3&gt;

&lt;p&gt;npm allows to create a file called "package.json".&lt;br&gt;
When you describe a package in this file, you can use it to install the package at once. It is also possible to make the description automatic when installing the package.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic command
&lt;/h2&gt;

&lt;p&gt;These are useful command of npm.&lt;/p&gt;

&lt;h4&gt;
  
  
  update npm
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install npm 
npm i npm 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Local package
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Install package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install [package name] 
npm i [package name] 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Uninstall package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm uninstall [package name] 
npm rm [package name] 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  update package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm update [package name] 
npm up [package name] 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  check the package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm list 
npm ls 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  package.json command
&lt;/h3&gt;

&lt;h4&gt;
  
  
  make package.json
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Today, I explained about basic Node.js.&lt;br&gt;
I hope this article helps you understand node.js!&lt;br&gt;
Happy coding! :)&lt;/p&gt;

</description>
      <category>node</category>
    </item>
    <item>
      <title>Why Designers Should Learn To React?</title>
      <dc:creator>Marina Yamaoto</dc:creator>
      <pubDate>Mon, 19 Apr 2021 13:48:03 +0000</pubDate>
      <link>https://dev.to/marina294/why-designers-should-learn-to-react-34bl</link>
      <guid>https://dev.to/marina294/why-designers-should-learn-to-react-34bl</guid>
      <description>&lt;p&gt;Hi everyone. &lt;br&gt;
If you are a designer, how do you work with front-end developers?&lt;br&gt;
In this article, I will show you how to use react to solve the problems that arise between the designer and the front-end developer.&lt;/p&gt;
&lt;h2&gt;
  
  
  The process of creating a website
&lt;/h2&gt;

&lt;p&gt;I work in the following order when creating websites for my company. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;branding with the client. Determine the purpose of the website. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a design using design tools such as AdobeXD, Sketch, Figma. and get confirmation from the client. Create instructions for the design system, etc., and pass the design to the front-end developer. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The front-end developer reviews the code and implements it. Repeat design check.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;production environment&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am mainly in charge of steps 1 and 2.&lt;br&gt;
However, the most important part of the website, the coding part, is always under pressure due to deadlines, and if there is a problem with the design, the code becomes more complicated, or if there are design changes, it may take longer than usual.&lt;br&gt;
In other words, there is a gap between the design part and the coding part of website production.&lt;br&gt;
I believe that designers and front-end developers should always work together to solve problems.&lt;/p&gt;
&lt;h2&gt;
  
  
  The gap between designers and front-end developers
&lt;/h2&gt;

&lt;p&gt;There is a gap between designers and front-end developers when creating websites.&lt;br&gt;
How can we solve this problem?&lt;br&gt;
First of all, there is no better way than communication between the designer and the front-end developer, and the designer's understanding of coding. &lt;/p&gt;
&lt;h2&gt;
  
  
  Understand React
&lt;/h2&gt;

&lt;p&gt;At first, what is React?&lt;br&gt;
React is a JavaScript library developed by Facebook for building UI parts on websites.&lt;/p&gt;

&lt;p&gt;React distinction.&lt;br&gt;
In React, the DOM (Document Object Model) operations for manipulating web pages use a virtual DOM to display the difference from the actual DOM, which makes it difficult to increase rendering costs even in large-scale development.&lt;/p&gt;

&lt;p&gt;Also, React.js for web development and React Native for native application development are available, and one of the appealing features of React.js is that both web applications and native smartphone applications can be developed using almost the same writing style.&lt;/p&gt;

&lt;p&gt;There are more basic distinctions from &lt;a href="https://reactjs.org/"&gt;React official site.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Declarative.&lt;br&gt;
React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.&lt;br&gt;
Declarative views make your code more predictable and easier to debug.&lt;/p&gt;

&lt;p&gt;Component-Based.&lt;br&gt;
Build encapsulated components that manage their own state, then compose them to make complex UIs.&lt;br&gt;
Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.&lt;/p&gt;

&lt;p&gt;Learn Once, Write Anywhere.&lt;br&gt;
We don’t make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code.&lt;/p&gt;

&lt;p&gt;Tha’s its high levels of performance and development efficiency, This library is used all over the world, including Netflix, Airbnb, Wix, and Reddit.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why designer should learn to React?
&lt;/h2&gt;

&lt;p&gt;React is mainly for creating UI parts (components), and is said to be an effective framework for web applications that use a lot of buttons and text boxes.&lt;br&gt;
A lot of designers must be using Atomic Design for their web and app designs. Atomic design is one way of thinking about design systems. They are similar to Atomic Design. &lt;br&gt;
Components are the Atoms and Molecules of Atomic Design.&lt;br&gt;
Because components can not have more than one element.&lt;br&gt;
If designers know about the components, they can help close the gap by reducing the amount of redesign work involved in creating a design system.&lt;/p&gt;
&lt;h2&gt;
  
  
  A better understanding of React components
&lt;/h2&gt;

&lt;p&gt;As mentioned earlier, React is a library of components. Every part can have its own state and data. For similar 　areas, only the data of the parts can be changed and reused many times.&lt;br&gt;
In React, you can create components in several ways depending on their roles. The first thing to keep in mind is the following two components.&lt;/p&gt;
&lt;h3&gt;
  
  
  Class components
&lt;/h3&gt;

&lt;p&gt;A class component is a classic method of defining components, using the class keyword to define components. A class component can have a state and lifecycle, which allows for flexible changes in content.&lt;/p&gt;
&lt;h3&gt;
  
  
  Function components
&lt;/h3&gt;

&lt;p&gt;Function components are very simple, have no state, and have no control. It is just a placeholder that draws a specific fixed element according to the value passed to it. In short, it is just a "function".&lt;/p&gt;

&lt;p&gt;Hmmmmm, sounds like class components are better than function components. because they can have a state. But function components can not have any state.&lt;br&gt;
Don't worry, we have "Hooks"! &lt;/p&gt;
&lt;h3&gt;
  
  
  Hooks
&lt;/h3&gt;

&lt;p&gt;A hook is a function that "hooks into" a function component with React features such as state and lifecycle. Hooks are a feature for using React without classes, so they do not work within classes.&lt;br&gt;
Yay! Now we can use function components like class components!!&lt;/p&gt;

&lt;p&gt;At last, what difference between class components and function components?&lt;/p&gt;
&lt;h3&gt;
  
  
  Pros of hooks
&lt;/h3&gt;

&lt;p&gt;At first, coding will be clear.&lt;br&gt;
Because hooks can make shorter code than classic components.&lt;br&gt;
So it looks brevity and easy to read.&lt;/p&gt;

&lt;p&gt;For Example, &lt;br&gt;
this is class component that wrote a counter system.&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;class&lt;/span&gt; &lt;span class="nx"&gt;Example&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="na"&gt;count&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="p"&gt;}&lt;/span&gt;

 &lt;span class="nx"&gt;render&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="p"&gt;(&lt;/span&gt;
     &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;You&lt;/span&gt; &lt;span class="nx"&gt;clicked&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;times&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&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="o"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;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;/div&gt;



&lt;p&gt;Function component&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;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&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;Example&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;You&lt;/span&gt; &lt;span class="nx"&gt;clicked&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;times&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&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;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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="o"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;
     &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;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;p&gt;This function component is less than 6 line class component! &lt;/p&gt;

&lt;h3&gt;
  
  
  Cons of hooks
&lt;/h3&gt;

&lt;p&gt;Components areas are different for each developer. So before you make components you have to communicate and find common ground with them.&lt;/p&gt;

&lt;h3&gt;
  
  
  should we use function components for everything?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://reactjs.org/docs/hooks-faq.html#should-i-use-hooks-classes-or-a-mix-of-both"&gt;The official site&lt;/a&gt; said you should use function components at first. &lt;br&gt;
But depends on the situation. Hooks also have rules.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only call Hooks at the top level. Don’t call Hooks inside loops, conditions, or nested functions.&lt;/li&gt;
&lt;li&gt;Only call Hooks from React function components. Don’t call Hooks from regular JavaScript functions. (There is just one other valid place to call Hooks — your own custom Hooks. We’ll learn about them in a moment.)
&lt;a href="https://reactjs.org/docs/hooks-overview.html#rules-of-hooks"&gt;Rules of Hooks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Material UI
&lt;/h2&gt;

&lt;p&gt;At last, I'd like to introduce a popular React UI framework &lt;br&gt;
&lt;a href="https://material-ui.com/"&gt;"Material UI".&lt;/a&gt;&lt;br&gt;
It is a UI component framework developed based on Google's Material Design.&lt;br&gt;
There are a lot of component types so it helps make your design system faster. &lt;/p&gt;

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

&lt;p&gt;Today, I show you "Why Designers Should Learn To React?". &lt;br&gt;
Designers think that the designs they come up with work quickly and as a matter of course. But if you understood front-end development, you will realize what is the design problems in development. It will help the project going faster.&lt;br&gt;
I'm happy if some designers are a bit interested in React by this article!&lt;br&gt;
Happy Coding!&lt;/p&gt;

</description>
      <category>design</category>
      <category>react</category>
    </item>
    <item>
      <title>Why you need Branding into Your Website?</title>
      <dc:creator>Marina Yamaoto</dc:creator>
      <pubDate>Mon, 08 Feb 2021 13:33:43 +0000</pubDate>
      <link>https://dev.to/marina294/how-to-incorporate-branding-into-your-website-2h6h</link>
      <guid>https://dev.to/marina294/how-to-incorporate-branding-into-your-website-2h6h</guid>
      <description>&lt;p&gt;Hi there!&lt;br&gt;
Have you ever created your own website?&lt;br&gt;
I know many developers are reading this web site. It's easy to make websites for you. But don't miss the branding part ;)&lt;br&gt;
With the spread of COVID-19 around the world, I'm sure you have more time to spend on yourself. Many people have started new hobbies.&lt;br&gt;
I think there are more and more people who want to start their own businesses, products, blogs or introduce their hobbies. If you are going to create a website, you want to make sure that many people will visit it.&lt;br&gt;
When creating a website, we tend to concentrate on the structure and logo design, color, and visual design. However, branding can improve the quality of your website.&lt;br&gt;
In this article, I would like to talk about how to incorporate branding into your website.&lt;/p&gt;

&lt;h2&gt;
  
  
  "BRANDING"
&lt;/h2&gt;

&lt;p&gt;At first, let's think about branding.&lt;br&gt;
Why do we need the branding to create a website?&lt;br&gt;
Branding helps to clarify the concept and identity of your website. It also makes it easier to understand what you need and what you don't need, and which pages should be prioritized, even if you need a complex site map like a corporate website. From the user's point of view, it is also easier to understand the purpose of the website and leave a good impression.&lt;br&gt;
Let's take a look at the basic process required for branding.&lt;/p&gt;

&lt;h2&gt;
  
  
  ■ Make a brand concept
&lt;/h2&gt;

&lt;p&gt;A brand concept is a general idea or abstract meaning behind a brand. A brand's concept is used to give consistency to a brand's identity. It can be described as the first thing you want to pop into your customer's heads when they think of your brand.&lt;br&gt;
That's what I mean users can understand what it is in an instant, and immediately visualize it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dOJba85j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1568219557405-376e23e4f7cf%3Fixid%3DMXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%253D%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D967%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dOJba85j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1568219557405-376e23e4f7cf%3Fixid%3DMXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%253D%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D967%26q%3D80" alt="Alt text of image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What kind of website do you want to create?
&lt;/h3&gt;

&lt;p&gt;As mentioned earlier, the format of your website will vary depending on whether you want to create a corporate site, sell products or services, start a blog, or show your own work.&lt;br&gt;
Once you have decided on the type of website you want to create, search to find out what types of websites are currently available. You will find that there are similarities in current trends, color trends, illustration taste, and even the structure of the website.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Brainstorming
&lt;/h3&gt;

&lt;p&gt;Brainstorm ideas for the features of your website.&lt;br&gt;
The important thing here is to come up with as many words as you can think of. For example, if you want to make a Bicycle store, it doesn't have to be directly related to a Bicycle store -&amp;gt; Bicycle -&amp;gt; City -&amp;gt; Cafe -&amp;gt; Coffee. Think of all the images that come out of your main theme.&lt;br&gt;
Brainstorming will give you "an idea of where the demand for your main theme is", "the positives and negatives", and "how you want your website to be seen".&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Think about who you want to deliver to.
&lt;/h3&gt;

&lt;p&gt;Who do you want the website to be seen by?&lt;br&gt;
It is also a good idea to create personas that assume the user's age group, gender, and behavior.&lt;br&gt;
If you are targeting a wide age range, think about the behaviors, hobbies, and personalities that they share.&lt;br&gt;
For example&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A man in his 30s who is looking for cycling as a sporting activity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. What does the brand offer?
&lt;/h3&gt;

&lt;p&gt;Think about the strengths and features of the brand and the value users will receive from the service.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintenance and customization&lt;/li&gt;
&lt;li&gt;A cafe where you can take a break&lt;/li&gt;
&lt;li&gt;hold events&lt;/li&gt;
&lt;li&gt;Test ride&lt;/li&gt;
&lt;li&gt;Enjoyment of holidays&lt;/li&gt;
&lt;li&gt;Peace of mind about something you use every day&lt;/li&gt;
&lt;li&gt;More relevant to users' lives&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Summarize in abstracted terms
&lt;/h3&gt;

&lt;p&gt;Finally, summarize the words you have written down.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the bicycle store where you can enjoy a free holiday&lt;/li&gt;
&lt;li&gt;the place that gives you a sense of security every day&lt;/li&gt;
&lt;li&gt;The bicycle store that makes you want to come back
It doesn't need to be as cool as a catchphrase.
It is important that the concept "conveys the information correctly".
Based on this concept, we will go to the next step.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ■ Create a mood board
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RtUx-T4s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.pexels.com/photos/1742370/pexels-photo-1742370.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26dpr%3D2%26h%3D650%26w%3D940" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RtUx-T4s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.pexels.com/photos/1742370/pexels-photo-1742370.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26dpr%3D2%26h%3D650%26w%3D940" alt="Alt text of image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a mood board?
&lt;/h3&gt;

&lt;p&gt;A mood board is a visual tool that communicates our concepts and visual ideas. It is a planned arrangement of images, materials, pieces of text, etc. that is intended to project a particular style or concept.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why we need it?
&lt;/h3&gt;

&lt;p&gt;Using a mood board helps you to express the vision you have in mind for the project. A mood board is a good starting point to get things done. It will help you collate and focus your ideas, and help to define the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to create a mood board
&lt;/h3&gt;

&lt;p&gt;it's easy to create. Internet, magazines, anything is fine. Gather all the visual images you can think of. Then put them all together.&lt;br&gt;
Key visuals, fonts, color usage, brand image, etc, move the images about on the board to create different compositions. Play around with the images until you are happy with the images that you have.&lt;br&gt;
What's important is that they tell your story.&lt;br&gt;
Even once a mood board has been created, it is important to make sure that only the image you are really looking for is there.&lt;br&gt;
Once the mood board is created, if any items do not match what you are looking for, you can exclude them as mismatches. However, instead of deleting the excluded items, keep them in the "exclusion list".&lt;br&gt;
In this way, you will be able to visualize that "this kind of image is not required", and the exclusion list itself will serve as a reference for future designs.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this article, we talked about the basics of branding and how to incorporate branding into your website.&lt;br&gt;
Branding is the foundation of anything you create.&lt;br&gt;
It is not an abstraction but can be verbalized. It can be shared with all people, not just yourself so that the value can be easily understood and communicated.&lt;br&gt;
It's easy to focus on the visible things like logos and designs, but once you think about who your website is for, what it's for, and how it communicates, your website will become even more attractive.&lt;br&gt;
Thank you for reading! Have a nice day :)&lt;/p&gt;

</description>
      <category>design</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to use built-in array methods in JavaScript</title>
      <dc:creator>Marina Yamaoto</dc:creator>
      <pubDate>Mon, 18 Jan 2021 16:29:51 +0000</pubDate>
      <link>https://dev.to/marina294/how-to-use-built-in-array-methods-in-javascript-10ci</link>
      <guid>https://dev.to/marina294/how-to-use-built-in-array-methods-in-javascript-10ci</guid>
      <description>&lt;p&gt;When using an array, you will find that you have to do long iterations in many situations.&lt;br&gt;
Do you want to make your code readable and simple?&lt;br&gt;
Can be done by using built-in objects.&lt;br&gt;
There are various built-in objects in JavaScript.&lt;br&gt;
In this article, I will explain how to use the built-in array methods.&lt;/p&gt;
&lt;h1&gt;
  
  
  What are built-in objects
&lt;/h1&gt;

&lt;p&gt;At first, what are built-in objects?&lt;br&gt;
Built-in objects provided from the beginning in JavaScript.&lt;br&gt;
There are four built-in objects: Array, Date, Math, and String for efficient handling of these objects. Each object has special-purpose properties and methods associated with it.&lt;/p&gt;
&lt;h1&gt;
  
  
  Array methods
&lt;/h1&gt;

&lt;p&gt;There are many array methods &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#instance_methods"&gt;on the list&lt;/a&gt;.&lt;br&gt;
let's see the top of useful methods.&lt;/p&gt;


&lt;h2&gt;
  
  
  "ADD &amp;amp; DELETE"
&lt;/h2&gt;


&lt;h2&gt;
  
  
  push()
&lt;/h2&gt;

&lt;p&gt;add a new element to the &lt;strong&gt;end&lt;/strong&gt; of the array. It returns the new length of the array. The original array will be modified.&lt;/p&gt;

&lt;p&gt;what is the good thing when you use push method?&lt;br&gt;
Let's see the example.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/VwKgwgj?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The example above shows two ways to add an element.&lt;br&gt;
the first method is to specify the element number[4], which is the number added by one from the current last element number of the array you want to add and assign 'squirrel' to it.&lt;br&gt;
The elements of an array do not have to be contiguous. Therefore the index of the element to be added does not have to be the current last index plus one. If the number is not the current last index, it will be null between the new element.&lt;/p&gt;

&lt;p&gt;The second is push method.&lt;br&gt;
When you use push method, you don't need to count the current last element number of the array.  &lt;/p&gt;

&lt;p&gt;But push() returns the new &lt;strong&gt;length&lt;/strong&gt; of the array.&lt;br&gt;
when you print the 'push', you can see the length.&lt;br&gt;
So when you would like to print the new array, you have to write 'pets'. &lt;/p&gt;
&lt;h2&gt;
  
  
  unshift()
&lt;/h2&gt;

&lt;p&gt;Add a new element or multiple elements to the &lt;strong&gt;top&lt;/strong&gt; of an array and returns the number of elements after the addition. The original array will be modified.&lt;/p&gt;

&lt;p&gt;It is used in the same way as push method, but if you are adding multiple elements at the same time, be careful about the order in which they are added. &lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/WNGPRpE?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Alphabet1 Result is adding multiple elements at the same time. The alphabet starts "A".&lt;br&gt;
Alphabet2 result starts C. Because alphabet2 is adding elements in each method. &lt;/p&gt;
&lt;h2&gt;
  
  
  pop()
&lt;/h2&gt;

&lt;p&gt;Removes the &lt;strong&gt;last&lt;/strong&gt; element of an array. It returns the element and changes the length of the array. If the array is empty, it returns undefined. The original array will be modified.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/Exgraja?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  shift()
&lt;/h2&gt;

&lt;p&gt;Removes the &lt;strong&gt;top&lt;/strong&gt; element of an array. It returns the element and changes the length of the array. If the array is empty, it returns undefined. The original array will be modified.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/mdrvMXX?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;First In First Out (FIFO) can be created by joining with push method as described above.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/xxEMqgZ?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  slice(start, end)
&lt;/h2&gt;

&lt;p&gt;It retrieves the array elements from the array at the position specified in the "start" argument to the one before the array element at the position specified in the "end" argument and returns them as a new array. The original array will &lt;strong&gt;not&lt;/strong&gt; be modified.　The original array will be modified.&lt;/p&gt;

&lt;p&gt;If it only "start" argument, it retrieves the array elements from the array at the position specified in the "start" argument to the last array element and returns them as a new array.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/OJRdjBB?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The difference between this method and the previous methods is that it does not modify the original array. So the Before array and After array are the same length.&lt;/p&gt;

&lt;h2&gt;
  
  
  splice(index, deleteCount, element1, …, elementN)
&lt;/h2&gt;

&lt;p&gt;Removes an element from an array or adds an element to an array, and returns the removed element. It can also replace a specified range of elements in an array with other elements.&lt;/p&gt;

&lt;h4&gt;
  
  
  - Remove
&lt;/h4&gt;

&lt;p&gt;If you do not specify any elements to be added, the elements in the specified range will simply be removed.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/oNzmGPa?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  - Add
&lt;/h4&gt;

&lt;p&gt;If the deleteCount is specified as 0, the element to be removed will be 0 and the element specified in the argument will be added before the element specified in the start index. &lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/vYXbWjL?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  - Replace
&lt;/h4&gt;

&lt;p&gt;If you specify elements to be added, the elements in the specified range will be replaced.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/GRjzOYN?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  "ORDER"
&lt;/h2&gt;

&lt;h2&gt;
  
  
  sort()
&lt;/h2&gt;

&lt;p&gt;Sort array elements by string order or by specified order and return the array after sorting. The original array will be modified.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/MWjLrmd?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If the element is a string, it’s very simple. But if the element contains a number, be careful.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/gOwqojK?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Whooops! It didn't sort!&lt;br&gt;
Even if the value stored in an element is a number, it is not sorted by the size of the number, but as a string after the number has been converted to a string. Therefore, the first character is sorted first, resulting in the result as shown above.&lt;/p&gt;

&lt;p&gt;In this case, compareFunction is useful.&lt;br&gt;
CompareFunction is a method of comparing two values and switching their order one by one.&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;compareFunc&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="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;b&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;In this example, it takes two arguments, "a" and "b", and returns the result of comparing "a &amp;lt; b" in return. By checking whether "a" is smaller than "b", the order is switched.&lt;/p&gt;

&lt;p&gt;"&amp;lt;", "&amp;gt;", "==", and "-" can be used as comparison conditions to change the ascending or descending order.&lt;/p&gt;

&lt;p&gt;Let's see the number example again.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/GRjzQrz?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Ta-dah! The numbers are now sorted!&lt;/p&gt;

&lt;p&gt;To sort in descending order, use the following&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/dypadzj?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  reverce()
&lt;/h2&gt;

&lt;p&gt;Sorts of array elements in reverse order. The original array will be modified.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/marina294/embed/LYRqQvX?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  "REPEAT"
&lt;/h2&gt;

&lt;h2&gt;
  
  
  forEach()
&lt;/h2&gt;

&lt;p&gt;It executes a provided callback function once for each array element.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is callback function?
&lt;/h4&gt;

&lt;p&gt;Callback function is Functions passed as arguments. &lt;br&gt;
and after the function "A" is executed, the function "B" specified in the argument can be executed.&lt;/p&gt;

&lt;p&gt;if you want iterative processing, you can use for loop.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/BaLMrRQ?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;forEach does not require such initialization and can be written very efficiently.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/rNMPdJq?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The forEach method extracts the elements in the array in order from the top and calls the callback function. The callback function is called with the value of the currently fetched element, the index of the element, and the array itself as arguments.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/marina294/embed/yLaZKQq?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;It is also possible to retrieve the contents of an object!&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/QWKYmXr?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  "CONVERT"
&lt;/h2&gt;

&lt;h2&gt;
  
  
  map()
&lt;/h2&gt;

&lt;p&gt;It executes a callback function for each element and &lt;strong&gt;returns&lt;/strong&gt; the result as &lt;strong&gt;a new array&lt;/strong&gt;.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/ZEpwooE?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In the callback function written as an argument, the value of the element received as an argument is converted to uppercase using the toUpperCase method, and the value is returned as the return value. After the same processing is done for all the elements, in turn, a new array with the returned values as elements is created and returned as the return value of the map method.&lt;/p&gt;

&lt;p&gt;The values of the elements in the new array are all uppercase versions of the values of the elements in the original array, but the original array is unmodified because the map method does nothing to the original array. It's called "undestructive method".&lt;br&gt;
for example sort(), splice(), push(), shift(), unshift(), reverse() will be modified of the original array. &lt;br&gt;
It's called "destructive method". &lt;br&gt;
When you want to back to the original array, if you already made "destructive method", you can't back to the original array. Sometimes it make many bugs. so please be careful to use "destructive method" in the code.&lt;/p&gt;
&lt;h4&gt;
  
  
  What the difference with forEach()?
&lt;/h4&gt;

&lt;p&gt;You noticed these methods are very similar. What the difference between them? &lt;br&gt;
the answer is "return".&lt;br&gt;
forEach() is just an execution method、but map() will return the result as an array after execution.&lt;/p&gt;

&lt;p&gt;Let's see the example.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/LYRqrKX?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This forEach() and map() are the same program and the result is the same. &lt;/p&gt;

&lt;p&gt;But how is "return"?&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/vYXbagY?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
forEach is "undefined".&lt;/p&gt;

&lt;p&gt;Yay! Only map() has returned!&lt;br&gt;
You can see that the execution result is able to get the array data as "return value".&lt;/p&gt;
&lt;h2&gt;
  
  
  reduce(call back(sum, element),Initial value)
&lt;/h2&gt;

&lt;p&gt;Add up the values of all the elements in the array in order and finally get the total value.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/marina294/embed/poEGZMO?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The first process will result in "1 + 2", and the sum will be stored in the accumulated value, and the next process will execute "3 + 3". Total value “15".&lt;/p&gt;

&lt;p&gt;What if the array elements contain objects?&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/LYRqJXy?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In such a case, if you do not specify the initial value, the object that is the value of the first element will be stored as it is as the initial value, which will not produce the intended result.&lt;br&gt;
Like this.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/VwKgGxW?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  "SEARCH"
&lt;/h2&gt;

&lt;h2&gt;
  
  
  filter()
&lt;/h2&gt;

&lt;p&gt;Use a callback function to determine whether or not the elements in the array meet the conditions, and create a new array with only the elements that meet the conditions.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/jOMdpxY?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In the callback function as the argument of the filter method, if the length of the element received as the argument is greater than 4, true is returned, otherwise false is returned. After calling the callback functions for all the elements, in turn, a new array containing the elements that returned true is created and returned as the return value of the filter method.&lt;/p&gt;

&lt;p&gt;The filter method does not do anything to the original array, so the original array is not modified. This method is undestructive method.&lt;/p&gt;

&lt;h2&gt;
  
  
  indexOf(element, firstIndex)
&lt;/h2&gt;

&lt;p&gt;Search the array for an element and returns its first index. If it is not found, returned -1.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/bGwzmNJ?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;there is one more character “Cat" in the string, but the program will terminate after returning the first matching position.&lt;/p&gt;

&lt;p&gt;What happens if you specify "2" as the "firstInde"?&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/marina294/embed/LYRqgGO?height=600&amp;amp;default-tab=js,result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
A second "Cat" will be output!&lt;/p&gt;

&lt;p&gt;That's all I introduced useful array methods in built-in objects! &lt;br&gt;
Enjoy coding :)&lt;/p&gt;

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